Java Utililty Methods JOptionPane Message

List of utility methods to do JOptionPane Message

Description

The list of methods to do JOptionPane Message are organized into topic(s).

Method

voidnotImplemented(final String message)
Popup a warning dialog displaying message.
JOptionPane.showMessageDialog(null, message, "Not Implemented", JOptionPane.WARNING_MESSAGE);
booleannoTo(String message)
Displays a confirmation window asking a user a yes or no question.
return !yesTo(message);
intoptionWindow(String message, String title, String[] options)
This method will display an option dialog box to get an index value of a given array of options
return JOptionPane.showOptionDialog(null, message, title, JOptionPane.DEFAULT_OPTION,
        JOptionPane.QUESTION_MESSAGE, null, options, 0);
voidpause(final String msg)
Pops up a message box, blocking the current thread.
JOptionPane.showMessageDialog(null, msg, "VisBio", JOptionPane.PLAIN_MESSAGE);
booleanplain(String title, Object message, JComponent parent)
Muestra un dialogo de confirmacion.
int option = JOptionPane.showConfirmDialog(parent, message, title, JOptionPane.OK_CANCEL_OPTION,
        JOptionPane.PLAIN_MESSAGE);
return JOptionPane.OK_OPTION == option;
voidpopup(Component parent, String message, String title)
popup
JOptionPane.showMessageDialog(parent, message, title, 1);
voidpopupMessage(String message)
Popup a message dialog.
JOptionPane.showMessageDialog(null, message, "Problem", JOptionPane.ERROR_MESSAGE);
voidpopupMessage(String title, String message)
Gives the user a popup message with no icon.
popupMessage(title, message, JOptionPane.PLAIN_MESSAGE);
floatpromptForFloat(Component parentComponent, String message, String title, float oldValue)
Utility function to prompt for new float value
float result = oldValue;
String newValue = promptForString(parentComponent, message, title, Float.toString(oldValue));
if (newValue != null) {
    try {
        result = Float.parseFloat(newValue);
    } catch (NumberFormatException e) {
        result = oldValue;
return result;
StringpromptForString(Component parentComponent, String message, String title, String oldValue)
Utility function to prompt for new string value
String result = oldValue;
String newValue = (String) JOptionPane.showInputDialog(parentComponent, message, title,
        JOptionPane.PLAIN_MESSAGE, null, null, oldValue);
if (newValue != null) {
    result = newValue;
return result;