List of utility methods to do JOptionPane Confirmation
int | displayConfirm(Component parent, String message, String title, int optionType, int messageType) display Confirm return display2(parent, message, title, optionType, messageType, null);
|
boolean | displayConfirmPane(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; |
boolean | getConfirmation(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); |
boolean | getConfirmation(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); |
boolean | getUserConfirmation(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; |
boolean | getUserConfirmation(String arg1) get User Confirmation int option = JOptionPane.showConfirmDialog(frame, arg1); if (option == JOptionPane.YES_OPTION) return true; return false; |
int | listConfirm(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); |
int | pedeConfirmacao(String msg, int opcoes, int tipoMsg) pede Confirmacao return JOptionPane.showConfirmDialog(framePrincipal, msg, tituloJanelaMsg, opcoes, tipoMsg);
|
boolean | quitConfirmed(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, ... |
boolean | retrieveUserConfirmation(String title, String message) retrieve User Confirmation return JOptionPane.showConfirmDialog(null, message, title,
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
|