Recently in the school curriculum design, Java programming needs to use the dialog box pop-up, the first response is JS in the alert and confirm,java words of the moment, read the study summarized as follows, for future study
1. Displays an error dialog box that displays the message ' Alert ':
Joptionpane.showmessagedialog (NULL, "Alert", "alert", joptionpane.error_message);
2. An internal Information dialog box is displayed with the message ' Information ':
Joptionpane.showinternalmessagedialog (frame, "information", "Information", joptionpane.information_message);
3. Displays an information panel with the options "yes/no" and the message ' Choose one ':
Joptionpane.showconfirmdialog (NULL, "Choose one", "Choose One", joptionpane.yes_no_option);
4. Displays an internal Information dialog box with the options "Yes/no/cancel", a message of ' choose one ' and a title message:
Joptionpane.showinternalconfirmdialog (Frame,
"Please choose one", "Information",
Joptionpane.yes_no_cancel_option,
Joptionpane.information_message);
5. Displays a warning dialog box with options OK, cancel,title ' Warning ', and message ' Click OK to continue ':
object[] options = {"OK", "Cancel"};
Joptionpane.showoptiondialog (NULL, "Click OK to continue", "Warning",
Joptionpane.default_option, Joptionpane.warning_message,
NULL, Options, options[0]);
6. Displays a dialog box that asks the user to type String:
String Inputvalue = joptionpane.showinputdialog ("Please input a value");
7. Displays a dialog box that asks the user to select a String:
Object[] PossibleValues = {"First", "Second", "third"};
Object SelectedValue = Joptionpane.showinputdialog (null, "Choose One", "Input",
Joptionpane.information_message, NULL,
PossibleValues, Possiblevalues[0]);
Pop-up dialog box in Java