📜  java机器人左键单击-Java代码示例

📅  最后修改于: 2022-03-11 14:52:09.698000             🧑  作者: Mango

代码示例1
public static void click(int x, int y) throws AWTException{
    Robot bot = new Robot();
    bot.mouseMove(x, y);    
    bot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
    bot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
}