Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Robot class and obtaining mouse position

807600Jul 18 2007 — edited Jul 18 2007
The Robot class has the mouseMove(int x, int y) method which allows you to position the mouse at the given x-y coordinates. I am trying to move the mouse using relative coordinates, i.e. move 200 pixels left, as opposed to moving to 400,800. Is there a way to obtain my cursor's current position? I've looked at the MouseEvent class, and I'm not very sure that would work, as it requires input from the mouse in order to trigger.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 15 2007
Added on Jul 18 2007
2 comments
610 views