This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How do you handle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How do you handle "cancel" in dialog box?" Watch "How do you handle "cancel" in dialog box?" New topic
Author

How do you handle "cancel" in dialog box?

justin kim
Greenhorn

Joined: Nov 12, 2003
Posts: 1
How do you handle the users response of "cancel" in a JOptionPane.showInputDialog dialog box?
Can anyone show me simple example?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8834
    
    7

The return value will be null if the user presses "Cancel". There's plenty of examples in the Swing Tutorial


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How do you handle "cancel" in dialog box?
 
Similar Threads
dialog box
CheckBox state
Java script dialog box
How does JOptionPane return the proper value?
how to cancel a closing JInternalFrame