Java Utililty Methods JOptionPane Confirmation

List of utility methods to do JOptionPane Confirmation

Description

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

Method

intdisplayConfirm(Component parent, String message, String title, int optionType, int messageType)
display Confirm
return display2(parent, message, title, optionType, messageType, null);
booleandisplayConfirmPane(String desc, String title)
display Confirm Pane
if (title == null)
    title = "Confirmation required";
int res = JOptionPane.showConfirmDialog(null, desc, title, JOptionPane.YES_NO_OPTION);
if (res == JOptionPane.YES_OPTION)
    return true;
else
    return false;
booleangetConfirmation(Component parent, String str)
Get user confirmation.
int res = JOptionPane.showConfirmDialog(parent, str, "Confirmation", JOptionPane.YES_NO_OPTION,
        JOptionPane.QUESTION_MESSAGE);
return (res == JOptionPane.YES_OPTION);
booleangetConfirmation(Component parent, String str)
Get confirmation.
int res = JOptionPane.showConfirmDialog(parent, str, "Confirmation", JOptionPane.YES_NO_OPTION,
        JOptionPane.QUESTION_MESSAGE);
return (res == JOptionPane.YES_OPTION);
booleangetUserConfirmation(Component cp, String message)
Asks the user confirmation
int option = JOptionPane.showConfirmDialog(cp, message, " Please Confirm...", JOptionPane.YES_NO_OPTION);
return option == JOptionPane.OK_OPTION;
booleangetUserConfirmation(String arg1)
get User Confirmation
int option = JOptionPane.showConfirmDialog(frame, arg1);
if (option == JOptionPane.YES_OPTION)
    return true;
return false;
intlistConfirm(Component comp, String title, String message, Object[] listModel)
Displays a confirm dialog box and returns the button pushed by the user.
JList list = new JList(listModel);
list.setVisibleRowCount(8);
Object[] message1 = { message, new JScrollPane(list) };
return JOptionPane.showConfirmDialog(comp, message1, title, JOptionPane.YES_NO_OPTION,
        JOptionPane.QUESTION_MESSAGE);
intpedeConfirmacao(String msg, int opcoes, int tipoMsg)
pede Confirmacao
return JOptionPane.showConfirmDialog(framePrincipal, msg, tituloJanelaMsg, opcoes, tipoMsg);
booleanquitConfirmed(Component parent, String message)
Quit Confirmation pop up dialog
if (message == null) {
    message = "Do you really want to close the application?\n"
            + "Doing so will cancel any running imports.";
String s1 = "No";
String s2 = "Yes";
Object[] options = { s2, s1 };
int n = JOptionPane.showOptionDialog(parent, message, "Exit Application", JOptionPane.YES_NO_OPTION,
...
booleanretrieveUserConfirmation(String title, String message)
retrieve User Confirmation
return JOptionPane.showConfirmDialog(null, message, title,
        JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;