Java examples for java.awt:Robot
Robot press Enter Key
//package com.java2s; import java.awt.AWTException; import java.awt.Robot; import java.awt.event.KeyEvent; public class Main { public static void pressEnterKey() { Robot robot = null;// w ww . j a v a2s .co m try { robot = new Robot(); } catch (AWTException e) { // TODO Auto-generated catch block e.printStackTrace(); } robot.keyPress(KeyEvent.VK_ENTER); robot.keyRelease(KeyEvent.VK_ENTER); } }