| | |
Robot class won't click the mouse
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
I have this code:
And I want it to click the "Start" button on Windows computers. The mouse moves to the correct location, but does not click. Advice?
Java Syntax (Toggle Plain Text)
try { robot = new Robot(); robot.mouseMove(0,900); robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); }catch(Exception e){}
it appears that Robot only works on swing buttons, and applications
My site, random PM's from people I haven't hear from before will be DELETED
"If people are good only because they fear punishment, and hope for reward, then we are a sorry lot indeed.",
"If we knew what it was we were doing, it would not be called research, would it? "-Albert Einstein
"If people are good only because they fear punishment, and hope for reward, then we are a sorry lot indeed.",
"If we knew what it was we were doing, it would not be called research, would it? "-Albert Einstein
•
•
Join Date: Feb 2008
Posts: 106
Reputation:
Solved Threads: 5
0
#4 19 Days Ago
try this instead. I had the same problem:
Java Syntax (Toggle Plain Text)
try { robot = new Robot(); robot.mouseMove(0,900); robot.mousePress(InputEvent.BUTTON1_MASK); robot.mouseRelease(InputEvent.BUTTON1_MASK); }catch(Exception e){}
![]() |
Other Threads in the Java Forum
Views: 1243 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Java
-xlint android api apple applet application arguments array arrays automation binary block bluetooth chat class classes client code compile component database developmenthelp draw eclipse encode error event exception file fractal freeze game gameprogramming givemetehcodez graphics gui helpwithhomework html ide image input integer iphone j2me j2seprojects java javac javaprojects jmf jni jpanel julia lego linux list loop loops mac map method methods mobile netbeans newbie notdisplaying number object online oracle print problem program programming project recursion scanner screen server set singleton size sms socket sort sql string swing system template test textfields threads time title transfer tree tutorial-sample update windows working





