Closing JOptionPane.ShowInternalOptionDialog programmatically
问题 My current design is like this: I have an outer frame that displays main app. When user clicks a button on the main app, a pop-up Window should be launched. I am using JOptionPane.showInternalOptionDialog and passing button objects as options. When user clicks one of these button, it should run certain commands and then close the window. I was not able to close the Frame that shows the pop-up. I found a similar question in this forum, that suggests the following workaround. Closing a dialog