aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes  click the mouse in a coordinate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark " click the mouse in a coordinate" Watch " click the mouse in a coordinate" New topic
Author

click the mouse in a coordinate

alona ariel
Ranch Hand

Joined: Sep 09, 2008
Posts: 36
Is it possible to click the mouse in a coordinate, so it give the x,y horizontal with regard to the (0,0) point?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

Define where (0,0) is. Is it the screen? The window? The parent control?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Hauke Ingmar Schmidt
Rancher

Joined: Nov 18, 2008
Posts: 433
    
    2
I am not quite sure what you want to achieve. Do you want to simulate a mouse click programmatically? Then have a look at java.awt.Robot.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2171
    
    7
Is it possible to click the mouse in a coordinate, so it give the x,y horizontal with regard to the (0,0) point?


That is exactly what the mouse point is. It is a point relative to the (0, 0) of the component you added the mouse listener to.

If you want the point relative to some other component then you can look at the SwingUtilities class for the "convert..." methods.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: click the mouse in a coordinate