List of utility methods to do JOptionPane Confirmation
boolean | askConfirmation(final Window aWindow, final String aMessage, final String aTitle) Asks the user for confirmation. return JOptionPane.showConfirmDialog(aWindow, aMessage, aTitle, JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION;
|
boolean | confirm(Component component, String title, String msg) confirm int rtn = JOptionPane.showConfirmDialog(component, msg, title, JOptionPane.OK_CANCEL_OPTION); return (rtn == JOptionPane.OK_OPTION); |
boolean | confirm(final Component component, final String title, final String message) Asks the user a yes or no question. if (!SwingUtilities.isEventDispatchThread()) { try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { confirmResult = confirm(component, title, message); }); ... |
boolean | confirm(String message) confirm return confirm(null, message);
|
boolean | confirm(String message) confirm Object[] options = { "Si", "No" }; int n = JOptionPane.showOptionDialog(new Frame(), message, "Confirmar", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]); return n == 0; |
boolean | confirm(String message, boolean typeYesNo) Pops up a confirmation dialog that requires user to type the word Yes into a text field in order to confirm the question asked. if (typeYesNo) { StringBuffer fullMsg = new StringBuffer(message); fullMsg.append(NEWLINE); fullMsg.append(NEWLINE); fullMsg.append(resUtil.getString("YesNoMessage")); String answer = javax.swing.JOptionPane.showInputDialog(null, fullMsg.toString(), resUtil.getString("YesNoTitle"), javax.swing.JOptionPane.QUESTION_MESSAGE); return (answer != null && answer.equalsIgnoreCase(resUtil.getString("Yes"))); ... |
boolean | confirm(String message, String title) confirm return JOptionPane.showConfirmDialog(null, message, title, JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION;
|
boolean | confirm(String msg) Mnenomic for JOptionPane#showConfirmDialog(Component,Object) int opt = JOptionPane.showConfirmDialog(null, msg); return opt == JOptionPane.OK_OPTION; |
boolean | confirm(String title, Object message, JComponent parent) Muestra un dialogo de confirmacion. int option = JOptionPane.showConfirmDialog(parent, message, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); return JOptionPane.OK_OPTION == option; |
boolean | confirmAction(Component comp, String title, String msg) confirm Action int decision = JOptionPane.showConfirmDialog(comp, msg, title, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (decision == JOptionPane.NO_OPTION) { return false; return true; |