Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

checking for cancel button push in joptionpane.showinputdialog

807600Jul 28 2007 — edited Aug 30 2008
I am using the following line to get input from a pop up in my program

String name = JOptionPane.showInputDialog("What is your name?");

When the pop up is displayed it shows an ok and cancel button, what can i do to check and see if the cancel button is pressed so that I can break out of that function?

Thanks for your help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 27 2008
Added on Jul 28 2007
4 comments
3,074 views