日期:2014-05-20 浏览次数:20673 次
import java.awt.event.*;
import java.awt.*;
public class Dol {
public static void main(String[] args)throws AWTException{
try {
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_TAB);
robot.delay(1000);
robot.keyRelease(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_F1);
robot.keyRelease(KeyEvent.VK_F1);
robot.keyPress(KeyEvent.VK_ESCAPE);
robot.delay(1000);
robot.keyRelease(KeyEvent.VK_ESCAPE);
robot.delay(1000);
robot.mouseMove(300, 300);
robot.mousePress(InputEvent.BUTTON3_MASK);
robot.delay(100);
robot.mouseRelease(InputEvent.BUTTON3_MASK);
} catch (AWTException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}