I have a CustomDialog
that extends JDialog
.
In its constructor
I have
setModalityType(ModalityType.APPLICATION_MODAL);
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
They dont seem to work well together: i think the Modality stucks the defaultcloseoperation
, and in the end i have to click twice the X
in order to get the CustomDialog
closed.
How should i act to obtain both
1- always on-top visualization (i use application_modal
for this)
2- dispose on close