multiple jframes question
I have a program that has a jframe with a button that opens up a second jframe. After the second frame is open, the user inputs some information and hits submit, at which time both jframes close.
The issue im having is that upon opening the second frame, the user can still go back to the first and keep clicking the button opening multiple second frames, which I do not want.
How can I set the first jframe so that when the second one is open, the user cannot get to the first jframe without exiting the second, or submitting and restarting the program?
As always, any help is greatly appreciated!
Re: multiple jframes question
Instead of using a JFrame for your second frame, use a JDialog in modal mode (read the API documentation for that class). This prevents the user to do anything with the first frame as long as the dialog is visible.