aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes how to get location of mouse click with respect to picture? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to get location of mouse click with respect to picture?" Watch "how to get location of mouse click with respect to picture?" New topic
Author

how to get location of mouse click with respect to picture?

shahidrasul shahid
Ranch Hand

Joined: Jan 28, 2008
Posts: 62
i use a jlabel with image. i want when i click on image it give me location, where i click with respect to image not screen.

picture is also scroll able (big) .


please some body help me.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Events of a MouseListener added to the JLabel will report mouse coordinates in the coordinates of the label.


luck, db
There are no new questions, but there may be new answers.
 
jQuery in Action, 2nd edition
 
subject: how to get location of mouse click with respect to picture?
 
Similar Threads
JTextArea
Thanks & How to
javascript image pop up
find application in market
jsp: Could not access the link from other machines