Out of curiosity, what did you try?
Type: Posts; User: KevinWorkman
Out of curiosity, what did you try?
If you want the JPanel to appear and disappear, then just set its visibility via the menu. If you want different JPanels to be in the same location at different times, then you want CardLayout....
Well yeah, the other half is to actually add it to the JFrame- which, if I'm understanding your question right, is where CardLayout comes into play.
I guess I'm just confused by what's stopping you. Just add a getter or a setter to pass the JPanel, then add it wherever you want.
I'm not really sure what your question is, but if you want to pass a reference between classes, simply call a getter or a setter with that JPanel.
It sounds like CardLayout might be your friend...