Java Swing UI Changing Method
Posted
by vigilant
on Stack Overflow
See other posts from Stack Overflow
or by vigilant
Published on 2010-03-27T17:05:33Z
Indexed on
2010/03/27
17:13 UTC
Read the original article
Hit count: 187
I would like to use Swing to program a simple learning game.
I am wondering what would be best way to switch between UI screens.
For example, I would have a screen for the Main Menu, and then when the user presses a button on that screen, I would swap out the whole screen for a completely different one.
Then, arbitrary screens can be swapped in at any moment, and all of their event handlers would be reactivated while the inactive screen's event handlers will be deactivated.
What type of Swing component/control would I use for each of the 'screens'. Is this even doable?
© Stack Overflow or respective owner