How can I make my application pause when I open custom JDialog and after the dialog is closed to make continue again.
Simply use:
setModal(true);
I usually call it from within the constructor of the JDialog.
JDialog
See the Javadocs on setModal(boolean). http://java.sun.com/javase/6/docs/api/java/awt/Dialog.html#setModal(boolean)
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.
setModal(true)
1.4m articles
1.4m replys
5 comments
57.0k users