I added the following JOptionPane into my InternalFrame (this): JOptionPane.showConfirmDialog(this, "Are you sure?", "title", JOptionPane_OK_CANCEL_OPTION); After I chose Ok or Cancel button, not only the JOptionPane was closed, but also the InternalFrame. How can I just close the JOptionPane and return to the InternalFrame?
"To err is human, but to really foul things up you need a computer." Paul Ehrlich.
That means the internal frame is already closing, you can pop up the option pane in response, but you can't do anything to stop it. You'll need to setDefaultCloseOperation() of the internal frame to DO_NOTHING_ON_CLOSE and dispose of the internal frame only if the user selects 'YES' in the option pane.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.