Question: How to stop window closing in "internalFrameClosing" event.
In an internal frame listener in the internalFrameClosing event I want to ask the user to confirm closure with a JDialog. The default close operation for the Internal Frame is "DO_NOTHINg. If the dialog answer is "YES" I just do frame.dispose() and it works. If the answer is "NO" I do frame.doDefaultCloseAction() which leaves the frame open as expected. However it always leaves the JDialog visible. If I do not do "frame.doDefaultCloseAction()" then the whole internal frame will close anyway. I have tried making the Dialog invisible or disposing it but it is still there. Is there a way to abort the frame closing event so the user can go back and save their work or do further edits? Thankyou for your assistance