Your use case, seems perfect for CardLayout.
In card layout you can add multiple panels in the same place, but then show or hide, one panel at a time.
More Related Contents:
- Only one component shows up in JFrame
- How to use CardLayout with Netbeans GUI Builder
- JPanel & components change position automatically
- Adding JPanels from other classes to the cardLayout
- FlowLayout on top of GridLayout not working
- How to right-justify icon in a JLabel?
- CardLayout showing two panels, flashing
- Providing white space in a Swing GUI
- Java: maintaining aspect ratio of JPanel background image
- Making a robust, resizable Swing Chess GUI [closed]
- Java: Difference between the setPreferredSize() and setSize() methods in components
- how to change UI depending on combo box selection
- What does .pack() do?
- paintComponent() vs paint() and JPanel vs Canvas in a paintbrush-type GUI
- JPanel positions and sizes changes according to screensize
- Rotate BufferedImage Inside JPanel
- Can’t a Swing component be added to multiple containers?
- Why does this GridBagLayout not appear as planned?
- Java Linux Terminal in JPanel
- How to show different pages from the center element of JFrame (having set to BorderLayout)
- Why does calling dispose() on Graphics object cause JPanel to not render any components
- Having images as background of JPanel
- Using addMouseListener() and paintComponent() for JPanel
- Java Swing – how to show a panel on top of another panel?
- .setBounds not working for JLabel and JButton
- Centering a JLabel in a JPanel
- How do I draw an image to a JPanel or JFrame?
- How to effectively use cardlayout in java in order to switch from panel using buttons inside various panel constructors
- Obtaining focus on a JPanel
- Can I add a component to a specific grid cell when a GridLayout is used?