Sunday, April 18, 2010

Creating a Confirm Dialog Box

The easiest way to create a Yes/No/Cancel dialog box is to use showConfirmDialog(Component, Object) method of JOptionPane class.
The following example uses a confirm dialog box with a text message and stores response in the response variable:
int response;
response = JOptionPane.showConfirmDialog(null, "Should i delete all files?");


source: java-tips.org

No comments:

Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory