aspose file tools*
The moose likes Java in General and the fly likes mouse related Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "mouse related" Watch "mouse related" New topic
Author

mouse related

Amit Bathla
Ranch Hand

Joined: Feb 11, 2005
Posts: 51
first:
we know that we can get co-ordinates of mouse pointer
through functions in
like
int a=getX();(for getting x co.)
similarly i wanna know that can we set mouse pointer to particular point
via any function call.please help me.

second:
we know that when we press mouse button certain event is generaated which is passed to operating system .
simillarly can we generate that event by ourself(expl), that is without clicking the mouse but generating that event.
help me to solve my problems
thanks in advance
bye


Amit
University of Florida
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
Look at the java.awt.Robot class. It has methods to move the mouse, generate mouse and keyboard events, move the mouse around, screen capture, etc...
Shyam Prasad Murarka
Ranch Hand

Joined: May 02, 2005
Posts: 209
Dear Steven,
While you posted this reply I was going through MouseEvent's API. I came across a method translatePoint(int x, int y). What is it used for? I didn't understand what they explained. It sounded something like changing the mouse position. Please explain.


With Best Regards,
Shyam Prasad Murarka
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

It just changes the x and y values that will be returned by getX() and getY(). It doesn't move the mouse pointer.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mouse related