dcsimg

How do I simulate mouse events?

John Zukowski

Starting with 1.3 you can use the java.awt.Robot class:

Robot robot = new Robot();
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);