Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MouseMotionListener  RSS feed

 
R.Joe
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JInternalFrame having JButton,JTable and JLabel
I have added the MouseMotionListener to the JInternalFrame
mousemoved event fires on JInternalFrame and JLabel but not in JButton or JTable

Pl help me out
Thanks in advance
 
Brian Cole
Author
Ranch Hand
Posts: 935
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by R.Joe:
I have a JInternalFrame having JButton,JTable and JLabel
I have added the MouseMotionListener to the JInternalFrame
mousemoved event fires on JInternalFrame and JLabel but not in JButton or JTable


Add the MouseMotionListener to the JButton and JTable also.
 
R.Joe
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it posible , we can add the MouseMotionListener to the container and it get automatically added to their components.
 
dave taubler
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default, a container's MouseMotionListener will receive (and effectively consume) MouseMotionEvents, such that its contained components won't receive them. You could do something like in your frame:



I didn't try that out, but I think it would work.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!