Due to JOptionPanes being almost unusably buggy I tend to often get grey and empty panes which I close down by pressing the upper right corner. When I do this the panes returns an anser Yes or No to my code whichI obviously do not want. How can I get my JOptionPanes to understand that it should reload the panel when I close it down?
Asked
Active
Viewed 39 times
-1
-
3"...JOptionPanes being almost unusably buggy.." No they are not buggy. Maybe you are using them wrong. Post some code that reproduces your problems. – ArcticLord Nov 30 '16 at 09:43
-
Well at least they are highly random when they work and when they dont... Im atleast looking for a way arounf this feature of randomness – vpJohan Nov 30 '16 at 09:47
1 Answers
2
Use one of the JOptionPane.showConfirmDialog()
methods like they show here and here. The default optionType
is Yes, No, Cancel, and the result will be CANCEL_OPTION
if you click the winbdow's close button. If you're getting empty panes just sometimes, be sure to use the event dispatch thread from the begining of your program.

Community
- 1
- 1

Catalina Island
- 7,027
- 2
- 23
- 42