• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1674
  • Last Modified:

Java Swing pass events to child of another Parent

Hi,
I am not sure if this has been brought up before, unless I happened to miss it when browsing. Problem is: I have a JFrame (the main frame), which has 2 JPanels a and b. Within JPanel a, I have several more JPanel's (BufferedImage holders) which has individual attached mouseEvents. When any of these mouseEvents are triggered, this information has to be passed to the JFrame (the mouseEvent handler's parent's parent), which will then trigger an animation sequence in JPanel b.
I've tried various means, including static variables, etc. but I can't seem to trigger the JFrame to init the other JPanel.
Any help would be appreciated.

Thanks
0
zhtet
Asked:
zhtet
  • 2
1 Solution
 
CEHJCommented:
You just need to add the JFrame as a mouse event listener for the panels' mouse events
0
 
zhtetAuthor Commented:
DOH!! guess i really need to hit the sack soon :) ...
Many Thanks for the quick response. Solution accepted.
0
 
CEHJCommented:
:-)
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now