Answers for "java switch display panel"

0

java switch display panel

CardLayout cardLayout = new CardLayout();
JPanel mainPanel = new JPanel(cardLayout);

MenuPanel menu = new MenuPanel();
GamePanel game = new GamePanel();
mainPanel.add(menu, "menu");
mainPanel.add(game, "game");

...
public void gameOn() {
    cardLayout.show(mainPanel, "game");
}
Posted by: Guest on June-23-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language