GeeCON Prague 2014*
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


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: 4572
    
    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.
 
GeeCON Prague 2014
 
subject: how to get location of mouse click with respect to picture?