文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>java-robot

java-robot

时间:2010-08-05  来源:cj_gameboy

import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
public class test {

    /**
     * @param args
     */
    public static void main(String[] args)throws Exception {
        // TODO Auto-generated method stub

        try {
            Robot robot = new Robot();
            //定义5秒的延迟以便你打开notepad

            // Robot 开始写

            robot.delay(5000);
            robot.keyPress(KeyEvent.VK_H);
            robot.keyPress(KeyEvent.VK_I);
            robot.keyPress(KeyEvent.VK_SPACE);
            robot.keyPress(KeyEvent.VK_C);
            robot.keyPress(KeyEvent.VK_A);
            robot.keyPress(KeyEvent.VK_O);
            robot.keyPress(KeyEvent.VK_E);
            robot.keyPress(KeyEvent.VK_R);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}


相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载