How do I show a JOptionPane without disabling any currently open frames?
I have a JFrame with a Start and Stop button. At any point, I want the user to be able to press the 'Stop' button on the main frame, to stop a secondary Thread (which was started by the Start button).
However the second running Thread sometimes opens a JOptionPane. When it does so, the main frame is disabled, and the user can't press the stop button.
(And when it opens multiple of these JOptionPanes in a row, it becomes immensely frustrating trying to stop it).
JOptionPane.showMessageDialog(null, "It's Broken Mate");
With no success. I also tried passing it a JFrame to disable:
JOptionPane.showMessageDialog(new JFrame(), "Still No Go");
That failed too. I even tried
JFrame frame = new JFrame(); frame.setVisible(true); JOptionPane.showMessageDialog(frame, "CMON Please");
And even furthermore,
JFrame frame = new JFrame(); frame.setVisible(true); JOptionPane.setRootFrame(frame); JOptionPane.showMessageDialog(frame, "I'm getting angry now.");
And STILL. Nothing. Does not work. It opens up a message box, and everything is disabled. I have to dismiss the JOptionPane before anything becomes enabled again...