1

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

2 Answers2

1

Look into JDialog

You can extend JDialog and call super in your constructor with the second parameter set to true


super(parent, true);   

jjnguy
  • 136,852
  • 53
  • 295
  • 323
user489041
  • 27,916
  • 55
  • 135
  • 204
1

Use a JDialog

You can set it to be modal in this JDialog(Frame, modal) constructor

Matt
  • 43,482
  • 6
  • 101
  • 102