I want to close a JOptionPane whenever the user types in 0 or -1. I have currently set up a boolean variable and assigned it a value of false. When the user types true, I want the window to close. However, I am not sure of a method which will close JOptionPane after the sentinel value is typed. Is there a way to do this?
posted 8 years ago
generally, that's not how a JOptionPane works i.e. the entry closing it.
the 0/-1 sentinel value is usually associated with a while()