INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

java robot class not working in windows 7 ? Why?

java robot class not working in windows 7 ? Why?

java robot class not working in windows 7 ? Why?

(OP)
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!!

RE: java robot class not working in windows 7 ? Why?

Difficult to guess: which robot class are you using? Can you see any errors?

Cheers,
Dian

RE: java robot class not working in windows 7 ? Why?

(OP)
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

RE: java robot class not working in windows 7 ? Why?

Maybe it's a privileges problem. Can you run it as admin or deactivate UAC?

Cheers,
Dian

RE: java robot class not working in windows 7 ? Why?

(OP)
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

RE: java robot class not working in windows 7 ? Why?

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close