如何控制(移动)鼠标光标



如何使用Java移动鼠标光标(窗口)?我有一对值不断更新。我想用它们来控制光标。

Robot.mouseMove(x,y)

如前所述:奥斯卡·雷兹 https://stackoverflow.com/a/2941373/1150918。

您将需要使用机器人类。

Robot r = null;
try {
    r = new Robot();
} catch (AWTException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}
r.mouseMove(x, y);//x is the horizontal position on the screen, y is the vertical

最新更新