I have this code:

try
        {
            robot = new Robot();
            robot.mouseMove(0,900);
            robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
        }catch(Exception e){}

And I want it to click the "Start" button on Windows computers. The mouse moves to the correct location, but does not click. Advice?

Recommended Answers

All 3 Replies

it appears that Robot only works on swing buttons, and applications

it appears that Robot only works on swing buttons, and applications

This is not true. Although this is what it was primarily intended.

try this instead. I had the same problem:

try
        {
            robot = new Robot();
            robot.mouseMove(0,900);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
        }catch(Exception e){}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.