Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java robot class not working in windows 7 ? Why? 1

Status
Not open for further replies.

we33pryor

Programmer
Apr 23, 2013
4
0
0
US
I have a java app using robot class to move the cursor, click controls, and send keystrokes to other app using windows xp home service pack 3. My issue is that the cursor does not even move when I attempt to run the app in windows 7. In windows 7 I am developing using Eclipse JEE 64 with JDK compliance 1.7. In windows xp I am at compliance 1.6. I have tried compliance 1.6 and 1.7 on windows 7 with no success. I have set both systems at the same screen resolutions. So the pixel positioning should be the same. It appears that the focus has to be on the java app in windows 7 and not the app I am trying to drive. Which will not accomplish the purpose of driving another app.
Does anyone have any suggestions? Thanks!!
 
Difficult to guess: which robot class are you using? Can you see any errors?

Cheers,
Dian
 
Dian, Thanks for the response. The class is java.awt.robot. There are no error messages. The mouse move, click, and keystrokes code executes. There are no errors thrown. The mouse events do not happen on the app I am trying to drive when the focus is on that app. If I leave the focus on eclipse while running in debug, the mouse moves and clicks occur on the eclipse window. But this is the wrong window. The app works fine in windows XP but not windows 7.

Thanks, for any suggestions.
Wallace
 
Maybe it's a privileges problem. Can you run it as admin or deactivate UAC?

Cheers,
Dian
 
I am running it as administrator. The code is executing with no errors. I believe java.awt.robot class has issues with windows 7, but I am not positive. If I leave focus on eclipse while the app is executing all the mouse moves, clicks, and sent keys happen in the eclipse window. Which is incorrect. If I change focus to the app I am trying to drive, no mouse moves, clicks, or sent keys are received in the driven app or anywhere else.
Thanks
 
[medal] Dian,
Thank you!!!! I thought I was running it as administrator. I ran eclipse as administrator and then it worked!!!!!!! I do not why there weren't any error messages. Thank you for the help!!!!
This issue is solved!!
Wallace
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top