java 自动打开浏览器并点击


Robot rb = new Robot();
rb.delay(3000);
int x = 40;
Desktop desktop = Desktop.getDesktop();
if (Desktop.isDesktopSupported() && desktop.isSupported(Desktop.Action.BROWSE)) {
URI uri = URI.create("http://www.baidu.com/");
try {
desktop.browse(uri);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("测试1");

// rb.mouseMove(x, 400);
rb.delay(3000);
rb.mouseMove(1046, 370);
rb.mousePress(InputEvent.BUTTON1_MASK);
rb.delay(1000);
rb.mouseRelease(InputEvent.BUTTON1_MASK);


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM