mouselistener for images

hi there

iwant to set mouse listener for the images
i know as image is not a component its not possbile but is there any other way to do that

basically i want to add a popup menu to the image when a image is right clicked a popup should be displayed

thanx
starter79Asked:
Who is Participating?
 
objectsCommented:
Then simply have your componant paint the ImageIcon. JLabel already supports this.
0
 
objectsCommented:
If you are using Swing then use a JLabel with an image icon.
0
 
objectsCommented:
for awt create component subclass that displays your image and add your mouse listener to that component.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
starter79Author Commented:
thanx objects

actually wut iam doing is tht iam using some other API ok
it's bbn's  openmap application

in that they have there own methods to plot an image on the screen (map) and tht too using Lat Lon

so in tht case i can only plot an instance of ImageIcon class
i havent seen any mehtod tht plots the component

can u guide some other way pls
i know it's tricky or may be difficult also
but then also i have to do it anyhow
thanx for taknig interest
0
 
objectsCommented:
hard to see without knowing the api u are using.
What can you add a mouse listener to?
0
 
starter79Author Commented:
i can add mouse listeners only to the components but iam plotting a ImageIcon
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.