Reputation:
My top-level container is MainFrame (JFrame)
. I want to be able to popup another JFrame with a JPanel that has two JTextFields from MainFrame
.
The thing is: I need to be able to block the EDT from the Swing GUI. This is reminscent of using a JOptionPane to block the EDT until the user has either hit OK
or CANCEL
.
The question is: Is it possible to create a "custom" JOptionPane with user-defined values that will block the EDT?
Thanks
Upvotes: 1
Views: 779
Reputation: 28304
Look into JDialog
You can extend JDialog
and call super in your constructor with the second parameter set to true
super(parent, true);
Upvotes: 1
Reputation: 44078
Use a JDialog
You can set it to be modal in this JDialog(Frame, modal) constructor
Upvotes: 1