List of utility methods to do JOptionPane Error
void | alertValidationError(final Component sourceComponent, final String message) alert Validation Error JOptionPane.showMessageDialog(sourceComponent, "Hold on.." + " Few values seems to be incorrect.!! Please correct them..\n" + message, "VALIDATION FAILED", JOptionPane.ERROR_MESSAGE); |
int | askForAStringInArray(String question, String header, Object[] options, String errorMessage, String errorHeader) Ask in a swing gui for something in array int res = JOptionPane.CLOSED_OPTION; while (res == JOptionPane.CLOSED_OPTION) { res = JOptionPane.showOptionDialog(null, question, header, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]); if (res == JOptionPane.CLOSED_OPTION) { JOptionPane.showMessageDialog(null, errorMessage, errorHeader, JOptionPane.ERROR_MESSAGE); ... |
T | askForAStringInArrayReturning(String question, String header, T[] options, String errorMessage, String errorHeader) Ask in a swing gui for something in array return options[askForAStringInArray(question, header, options, errorMessage, errorHeader)];
|
int | contChoose(final Component parent, final String title, final String message, final String noContMsg, boolean cont, boolean error) cont Choose final int optionType = (error) ? JOptionPane.ERROR_MESSAGE : JOptionPane.WARNING_MESSAGE; if (cont) { return JOptionPane.showConfirmDialog(parent, message, title, JOptionPane.YES_NO_CANCEL_OPTION, optionType); } else { JOptionPane.showMessageDialog(parent, noContMsg, title, optionType); return -1; |
void | createAndShowErrorPanel(String title, Map create And Show Error Panel JPanel jp = new JPanel(new BorderLayout(0, 0)); jp.setPreferredSize(new java.awt.Dimension(640, 480)); JTabbedPane tabs = null; if (messages.size() > 1) { tabs = new JTabbedPane(); jp.add(tabs); for (String key : messages.keySet()) { ... |
void | displayError(Component parent, String title, String message) display Error JOptionPane.showMessageDialog(parent, message, title, JOptionPane.ERROR_MESSAGE); |
void | displayError(String message) display Error JOptionPane.showMessageDialog(null, message, "Error!", JOptionPane.ERROR_MESSAGE);
|
void | displayError(Throwable e) display Error displayMessageBox(e == null ? "Error performing operation." : e.getMessage(), JOptionPane.ERROR_MESSAGE,
false);
|
void | displayErrorMessage(Component component, Throwable t) display Error Message Frame parent = null; for (Component c = component; c != null && parent == null; c = c.getParent()) { if (c instanceof Frame) { parent = (Frame) c; JDialog dialog = createExceptionDialog(parent, t.getClass().getName(), t); dialog.setVisible(true); ... |
void | displayErrorMessage(Component parent, String message) Pops up error message dialog JOptionPane.showMessageDialog(parent, message, "Error", JOptionPane.YES_NO_OPTION);
|