How to pause execution while JDialog is open
Simply use:
setModal(true);
I usually call it from within the constructor of the JDialog
.
See the Javadocs on setModal(boolean)
.
http://java.sun.com/javase/6/docs/api/java/awt/Dialog.html#setModal(boolean)
That will cause execution to block on the current thread until the dialog box closes.
Alternatively, you can use:
setModalityType(Dialog.DEFAULT_MODALITY_TYPE);
It is equivalent to setModal(true)
and technically the correct way to do it.