I am somewhat new to coding and I need a little help. I am making a program where you start in the main menu. In the main menu there is an options button you can click on that will open a new jframe with the options. I was wondering if there was a way so that you would have to use the new JFrame before using the older (or main) one.
Asked
Active
Viewed 32 times
1 Answers
2
Take a look at How to Make Dialogs.
A modal dialog is one that must be dismissed (closed) before you can interact with program again (an example might be the open/save dialog of Word or your web browser)
But you should also have a read through The Use of Multiple JFrames: Good or Bad Practice? first...
Alternatively, you could use a CardLayout
, which would allow you to switch between views from within the same window
You could also use a JTabbedPane
which will allow you to have your views presented on the screen and accessible via a "tab", meaning the user can only interact with a single view, but they can navigate to a different view by clicking the tab they want.

Community
- 1
- 1

MadProgrammer
- 343,457
- 22
- 230
- 366