This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Add mouselistener to an image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Add mouselistener to an image" Watch "Add mouselistener to an image" New topic
Author

Add mouselistener to an image

Demith Waruna Samaraweera
Greenhorn

Joined: Sep 20, 2004
Posts: 4
I have an application where a Label is added on a LScrollPannel and my image is loaded on to the JLabel. I want add mouseMotionLisener to image loaded in the JLabel, and also change the origin coordinates
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

You can't add it to the image. You have to add it to a component, like, JLabel.


GenRocket - Experts at Building Test Data
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Add mouselistener to an image
 
Similar Threads
Transparent Swing components?
Image in JTable
Can i add an image directly to a JLabel or JWindow?
Adding an Image to a Panel
QTCanvas (QuickTime) & java