Hi, I have one class where JFrame is created and 4 classes (JPanels - Menu, Game, Score, etc.).
In the class, where I am creating Frame I also create new Menu (JPanel) .. in menu, I have 4 buttons. If I click e.g. on a button Start ... the new Game is created, so I add JPanel Game to the frame and I set visibility of JPanel Menu to false.
But I dont know how to go back from Game to menu without creating multiple JPanels. Any idea how to solve this ?

Look at using the Card layout for switching from one display to another.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.