| 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: 19216
|
|
|
Define where (0,0) is. Is it the screen? The window? The parent control?
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Hauke Ingmar Schmidt
Rancher
Joined: Nov 18, 2008
Posts: 371
|
|
|
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: 1787
|
|
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: jrebel
|
|
subject: click the mouse in a coordinate
|
|
|