jQuery in Action, 2nd edition*
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
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: 15286
    
    6

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


GenRocket - A Test Data Generation Platform
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Add mouselistener to an image
 
Similar Threads
QTCanvas (QuickTime) & java
Transparent Swing components?
Can i add an image directly to a JLabel or JWindow?
Adding an Image to a Panel
Image in JTable