File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Add mouselistener to an image" Watch "Add mouselistener to an image" New topic

Add mouselistener to an image

Demith Waruna Samaraweera

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: 15302

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

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: Add mouselistener to an image
It's not a secret anymore!