|
Simulating Movement of the Cursor on the Screen |
|
|
Following example shows how to simulate movement of the cursor using java.awt.Robot class in Java. Mainly, mouseMove method is used with the parameters specifying target point to move the cursor.
try {
// These coordinates are screen coordinates
int xCoord = 500;
int yCoord = 500;
// Move the cursor
Robot robot = new Robot();
robot.mouseMove(xCoord, yCoord);
} catch (AWTException e) {
e.printStackTrace();
}
|
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.