posted 21 years ago
Hi. I have a JOptionPane that is giving the user options of OK and CANCEL. I am trying to execute code based on what the user presses, but can't get it to work and I can't seem to figure out what I'm doing wrong.
Here's my code:
When I press cancel, the code doesn't execute.
I printed out the value of "value" and it displays as 1. When I printed out the value of "CANCEL_OPTION" it is equal to 2.
Why isn't this working? I guess I don't understand exactly how int's are assigned for the different fields of JOptionPane and how to use them properly.
Could someone please help me?
Thanks!