• Post Reply Bookmark Topic Watch Topic
  • New Topic

Mouse Listener on Component  RSS feed

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have set a MouseListener on a JLabel. When my mouse enters this JLabel I do Component c = myPanel.getComponentAt(mx, my), where mx and my are the location point in myPanel (which has a mouseMotionListener on it).
My problem is that it is not grabbing the JLabel component. I do a System.out.println(c.toString()) and it gives me the Containter which is myPanel. Does anyone know how I can get it to grab the JLabel??
Thanks

------------------
Happy Coding,
Gregg Bolinger
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!