We help IT Professionals succeed at work.

JPanel component's MouseListener don't work

paredes_mynor
on
321 Views
Last Modified: 2006-11-17
I have a subclass jp_1 that extends JPanel and implements MouseListener.  This jp_1 has many JLabels.  Since it implements MouseListener, it has already declared the respective mouseEntered, mouseClicked, ....., etc methods.

Now, jp_1 is added to a BorderLayout type panel (jp_a), within the CENTER constraint.  My problem is that, it's supossed that the components (JLabels) of the jp_1 panel should listen to the mouse motion (entered, exited, clicked, etc.), but they don't!!!!  I tried to debug it, but it doesn't even reach the checkpoints that I put in the mouse related methods of jp_1.

Could you guys please help me with this?  Thanks in advance.
Comment
Watch Question

Java Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Sorry, feel like stup........  Thanks.
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
Don't feel stupid, we all make mistakes sometimes :)

http://www.objects.com.au/staff/mick
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.