• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do you handle "cancel" in dialog box?

 
justin x kim
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you handle the users response of "cancel" in a JOptionPane.showInputDialog dialog box?
Can anyone show me simple example?
 
Joe Ess
Bartender
Pie
Posts: 9266
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The return value will be null if the user presses "Cancel". There's plenty of examples in the Swing Tutorial
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic