This week's book giveaway is in the Agile forum.
We're giving away four copies of The Software Craftsman and have Sandro Mancuso on-line!
See this thread for details.
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 The Software Craftsman this week in the Agile 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: 4816
    
    6

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.
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: how to get location of mouse click with respect to picture?