| | |
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: 107
Reputation:
Solved Threads: 5
0
#4 21 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: 1246 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Java
android api apple applet application arguments array arrays automation bidirectional binary birt bluetooth calculator chat class classes client code columns component database designadrawingapplicationusingjavajslider detection draw eclipse editor error errors event exception expand file fractal game givemetehcodez graphics gui guidancer helpwithhomework html ide image inetaddress input integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jme jmf jni jpanel julia linux list loop map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie number object oracle os plazmic print problem program programming project recursion scanner screen server set signing size smart sms smsspam socket sort sql string subclass support swing test threads time transfer tree windows





