Java Utililty Methods JOptionPane Error

List of utility methods to do JOptionPane Error

Description

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

Method

voidshowErrorDialog(JFrame parent, Exception ex)
show Error Dialog
JTextArea textArea = new JTextArea();
textArea.setFont(new Font("Sans-Serif", Font.PLAIN, 10));
textArea.setEditable(false);
StringWriter writer = new StringWriter();
ex.printStackTrace(new PrintWriter(writer));
textArea.setText(writer.toString());
JScrollPane scrollPane = new JScrollPane(textArea);
scrollPane.setPreferredSize(new Dimension(350, 150));
...
voidshowErrorMessage(Component c, Exception e)
show Error Message
JOptionPane.showMessageDialog(c, "Error caught: " + e.getMessage(), "ERROR", JOptionPane.ERROR_MESSAGE);
voidshowErrorMessage(Component parent, String message)
Method used to show an error dialog on the screen
JOptionPane.showMessageDialog(parent, message, "Error", JOptionPane.ERROR_MESSAGE);
voidshowErrorMessage(Component parent, String str)
Display error message.
JOptionPane.showMessageDialog(parent, str, "Error!", JOptionPane.ERROR_MESSAGE);
voidshowErrorMessage(Component parent, String str)
Show error message.
JOptionPane.showMessageDialog(parent, str, "Error!", JOptionPane.ERROR_MESSAGE);
voidshowErrorMessage(Component parent, Throwable error)
show Error Message
String message;
if (error.getMessage() != null) {
    message = error.getMessage().replaceAll(":", ":\n");
} else {
    message = error.getClass().getName();
error.printStackTrace();
JOptionPane.showMessageDialog(parent, message, "Error", JOptionPane.ERROR_MESSAGE);
...
voidshowErrorMessage(Component parentComponent, String message, String title)
show Error Message
showMessage(parentComponent, title, message, JOptionPane.ERROR_MESSAGE);
voidshowErrorMessage(Component theParent, String theMessage)
show Error Message
JOptionPane.showMessageDialog(theParent, theMessage, "hUnit", JOptionPane.ERROR_MESSAGE);
voidshowErrorMessage(final JComponent parent, final String message, final String title)
show Error Message
JOptionPane.showMessageDialog(parent, message, title, JOptionPane.ERROR_MESSAGE);
voidshowErrorMessage(final Window aParent, final String aMessage)
Convenience method to show an error message.
JOptionPane.showMessageDialog(aParent, aMessage, "Error ...", JOptionPane.ERROR_MESSAGE);