Create yes/no question dialog with JOptionPane in Java
Description
The following code shows how to create yes/no question dialog with JOptionPane.
Example
import javax.swing.JOptionPane;
/*from w w w.j av a 2 s. c o m*/
public class Main {
public static void main(String[] args) {
JOptionPane.showConfirmDialog(null, "or no", "choose yes",
JOptionPane.YES_NO_OPTION);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Swing »
Java Tutorial »
Swing »