-
Switching Screens
New to Java, this may seem like a stupid question to some but what is the best way to switch screens in Java. For example say I load my program up at the intro screen, and I select a new option from my JMenuBar. What is the best to load the screen and close the current one. I would imagine there must be a better way than changing the setVisible.
Basically does anyone have a good design pattern for a menu system program, jumping between screens and keeping global variables, such as the userid from example.
-
What is a screen? A window, dialog, JOptionPane, frame or ?
-
Say a jframe for example, and i want to load up a new one and close the existing one.
-
What methods are in the API doc for JFrame or the classes that it extends that look like they would "close" it?
Look at dispose and setVisible for example.
Do you have a copy of the API doc?
-