Skip to content
Advertisement

How to make an app using swing that only uses 1 JFrame?

I am making an app or (something.exe). I want to make a class that will serve as my main frame. That is because I don’t want to create new frame for each class that I will make. I want my class MainMenu to have the Frame of MainFrame where I can put buttons and etc.

JavaScript
JavaScript
JavaScript

Advertisement

Answer

Make use of

You can also make use of CardLayout to help facilitate the switching between different views, for example

JavaScript

JTabbedPane is also a good way for allowing the user to switch between different views, see How to Use Tabbed Panes for more details

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement