Modal JDialog without blocking execution

ps-aux picture ps-aux · Jun 3, 2014 · Viewed 8.9k times · Source

Is there a way how to use a dialog in Swing which prohibits any gui activity under it but at the same time DOES NOT stop execution on the thread where it was set to visible?

Answer

Mr Coder picture Mr Coder · Aug 7, 2015

Yes it can be done .

dlg.setModal(false);

or

dlg.setModalityType(Dialog.ModalityType.MODELESS);

where dlg is instance of your JDialog .