Java中用Robot类控制鼠标和键盘的方法2

来源:互联网 发布:linux 强制删除文件 编辑:程序博客网 时间:2024/09/21 08:48
pressKey(robot, KeyEvent.VK_J);pressKey(robot, KeyEvent.VK_A);pressKey(robot, KeyEvent.VK_V);pressKey(robot, KeyEvent.VK_A);pressKey(robot, KeyEvent.VK_SPACE);pressKey(robot, KeyEvent.VK_R);pressKey(robot, KeyEvent.VK_O);pressKey(robot, KeyEvent.VK_B);pressKey(robot, KeyEvent.VK_O);pressKey(robot, KeyEvent.VK_T);pressKey(robot, KeyEvent.VK_ENTER);}robot.delay(3000);closeApplication(robot);} catch (AWTException e) {e.printStackTrace();}}}

原创粉丝点击