Create a Confirm Dialog with JOptionPane in Java
Description
The following code shows how to create a Confirm Dialog with JOptionPane.
Example
//from www.j a v a2 s . c om
import javax.swing.JOptionPane;
public class Main {
public static void main(String[] argv) throws Exception {
int response = JOptionPane.showConfirmDialog(null, "Should i delete all files?");
}
}
The code above generates the following result.
Home »
Java Tutorial »
Swing »
Java Tutorial »
Swing »