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);