This section describes some static methods in the JOptionPane class that can be used to create and display different types of option dialog boxes.
javax.swing.JOptionPane - A Swing class that allows to create and display option dialog boxes.
Interesting methods of JOptionPane include:
showMessageDialog() - Method to create and display a message dialog box to present regular, warning or error messages.
showConfirmDialog() - Method to create and display a confirmation dialog box with yes, no and cancel buttons.
showInputDialog() - Method to create and display an input dialog box to prompt for some input.
showOptionDialog() - Method to create and display a generic dialog box to present message, take a confirmation, or take some input.
showInternal*Dialog() - Methods to create and display internal dialog boxes, displayed inside the main frame.
All dialog boxes created with the JOptionPane class are modal, disabling all other user interface components
on other frames. Each call of show*Dialog() method blocks the execution until the dialog box is closed.
All dialog boxes must created with parent frame.
The message type of an option dialog box controls the icon used on the left side of the message text.
The option type of an option dialog box controls what option buttons to be displayed.
The option buttons can be customized with your own option strings.