How to create multiple screens in Java?

2.2k views Asked by At

I have been playing around with trying to get a menu screen for my game. I have only been able to figure out how to paint a new Screen on top of an existing one; meaning that the actual game is still running behind the title screen. I don't need actual code but just a description of how I would go about this.

1

There are 1 answers

2
Jason Braucht On

One way to display a menu would by by using a JDialog outside of your main application window. Take a look at the How to Make Dialogs tutorial for more information.

Another possibility would be to use JInternalFrame for your game and menu so they can be wrapped in a larger application frame. These are explained nicely in How to Use Internal Frames