my dog learned polymorphism*
The moose likes Java in General and the fly likes Alternate mouse control Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Alternate mouse control" Watch "Alternate mouse control" New topic
Author

Alternate mouse control

Tejas Bondre
Greenhorn

Joined: Nov 29, 2010
Posts: 3
I have a java program that outputs X-Y co-ordinates in the form of a file and in the form of a stream. A new co-ordinate is obtained 16 times every second. I need to control my mouse pointer using these co-ordinates so that i wouldn't have to use the regular mouse. Please give some hints how to approach this problem. Would I need to study the device driver for mouse? Or is there a simpler way using swing/awt/applet APIs? Thank You.
Siddhesh Deodhar
Ranch Hand

Joined: Mar 05, 2009
Posts: 117
java.awt.Robot class can be used to control mouse pointer. Please check.


Good, Better, Best, Don't take rest until, Good becomes Better, and Better becomes Best.
Sidd : (SCJP 6 [90%] )
Tejas Bondre
Greenhorn

Joined: Nov 29, 2010
Posts: 3
Thank you very much. That's exactly what i wanted.
One more question - how could i have found that on my own?
Siddhesh Deodhar
Ranch Hand

Joined: Mar 05, 2009
Posts: 117
One more question - how could i have found that on my own?


I guess you should have goggled "Controlling mouse using java"
I had worked with Robot class few years back. So remembered it instantly.

 
Consider Paul's rocket mass heater.
 
subject: Alternate mouse control
 
Similar Threads
Draw rectangle by dragging mouse
graph
Resizing frame when positioning the mouse in the frame
Problem in finding the bounds of rectangle.....
Hey ranchers...a lil help here plz