This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma 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 Java Interview Guide this week in the Jobs Discussion 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

How do you handle "cancel" in dialog box?

justin x kim

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

Joined: Oct 29, 2001
Posts: 9191

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

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: How do you handle "cancel" in dialog box?
It's not a secret anymore!