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

voidshowSuccessMessage(Component parentComponent, String message)
show Success Message
showSuccessMessage(parentComponent, message, "Success");
booleanshowYesNo(Component parent, String title, String message)
show Yes No
int IGNORED = -1;
Object no = "No";
Object yes = "Yes";
Object arr[];
arr = new Object[2];
arr[0] = no;
arr[1] = yes;
JOptionPane p;
...
intshowYesNoCancel_old(Component parent, String title, String message)
This works fine except that the YES button is initially selected and is also the default button.
return JOptionPane.showConfirmDialog(parent, message, title, JOptionPane.YES_NO_CANCEL_OPTION);
booleanshowYesNoMessage(Component parent, String message)
show Yes No Message
return JOptionPane.showConfirmDialog(parent, message, "Warning",
        JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
StringtestInput(String message)
test Input
return JOptionPane.showInputDialog(null, message, "Test", JOptionPane.PLAIN_MESSAGE);
booleanyesNo(Component parent, String message, String title)
yes No
return 0 == JOptionPane.showConfirmDialog(parent, message, title, JOptionPane.YES_NO_OPTION);
booleanyesTo(String message, Component parent)
Displays a confirmation window asking a user a yes or no question.
int c = JOptionPane.showConfirmDialog(parent, message, "Confirm", JOptionPane.YES_NO_OPTION,
        JOptionPane.QUESTION_MESSAGE);
boolean out = c == JOptionPane.YES_OPTION;
return out;