So im writing a GUI for a simple boardgame. I want to have a menu with several buttons, two of them are for example "Start game" or "Options" etc... If i click "Start game" i want to get to the next page/scene. Whats the best way of doing so? I want everything to happen in one JFrame.
I thought about removing all components with getContentPane().remove(); and then adding the new components i want to have. But i would also like to be able to get back to the menu again when pressing the "back" button for example. And removing and adding everything again all the time seems a bit of too much work for that simple task.
Is it possible to get somehow redirected to a new "scene" when pressing a button or something like that? I´m sure there has to be a better way than the one i listed above.