Simulating Mouse and Key Presses
This feature is useful for tools that test windowing applications.
try {
Robot robot = new Robot();
// Simulate a mouse click
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
// Simulate a key press
robot.keyPress(KeyEvent.VK_A);
robot.keyRelease(KeyEvent.VK_A);
} catch (AWTException e) {
}
Excellent code snippet. This was really helpful in a program I wrote to automate some administrative tasks.
Just give me how to simulate mouse pointer and clicks with a running example please...
Thanks...