The Artima Developer Community
Sponsored Link

Java Answers Forum
getting mouse click on an image inside a jlabel..

1 reply on 1 page. Most recent reply: Jun 10, 2002 10:12 PM by abhijeet

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
jf

Posts: 3
Nickname: jf
Registered: Jun, 2002

getting mouse click on an image inside a jlabel.. Posted: Jun 10, 2002 7:30 AM
Reply to this message Reply
Advertisement
hey there,

i have problem getting mouse click on an image i'm placing into, a jlabel, i've tried couples of thing but nothing works out. when the jlabel is empty, all is working fine but when i fill it up with an image, i cant get any event from it.

any help would be really appreciated.

thanks,

jf


abhijeet

Posts: 21
Nickname: sony
Registered: May, 2002

Re: getting mouse click on an image inside a jlabel.. Posted: Jun 10, 2002 10:12 PM
Reply to this message Reply
Hi JF,

I think the problem is that the JLabel is not recognizing your mouse event because you have kept an image over that JLabel. So, the image is covering all the JLabel co-ordinates. Write the same mouse event for the image and not for the JLabel. This is because, you are clicking on the image but not on the JLabel.

abhijeet.

Flat View: This topic has 1 reply on 1 page
Topic: Where does it go wrong?? Previous Topic   Next Topic Topic: NoClassDefFoundError....What's Wrong ?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use