I am currently making a text based game using swing and I am running into a problem. I currently have a JFrame and 2 different panels(much more will be added). However, I can't figure out how to switch between the two panels. The first panel has a JList for a list of characters with some buttons at the bottom. One button in particular is an Add button. When the user clicks on the button, I want the first panel not to be visible, and for the second panel to become visible. Once they click save on the second panel, I want the second panel not to be visible, and the first panel to become visible. I am using a method to pass the character information back to the first panel to add the new character to the list. Just having trouble displaying the two panels. I am trying not to make the classes static. With a bunch on other panels to add and display, I want to be able to dispose of the panels not being used to free up memory. Any advice would greatly be appreciated.