Members - Reputation: 101
Posted 23 February 2012 - 04:02 PM
Crossbones+ - Reputation: 7498
Posted 23 February 2012 - 05:58 PM
1 that uses the card layout
1 for your main menu
1 for your game
Add the JPanels for the menu and for the game to the jpanel that uses the cardlayout , pass an identifying string along with them.
mainPanel = new JPanel(new CardLayout());
When you wish to change the visible JPanel you grab the layout from the main panel (The one that uses the card layout) using:
CardLayout layout = (CardLayout)(mainPanel.getLayout());
and then change the visible panel using
The voices in my head may not be real, but they have some good ideas!