Java Utililty Methods JOptionPane Warning

List of utility methods to do JOptionPane Warning

Description

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

Method

voiddisplayWarning(String strMsg)
display Warning
displayMessageBox(strMsg, JOptionPane.WARNING_MESSAGE, false);
voiddisplayWarningMessage(Component parentComponent, String message, String windowTitle)
display Warning Message
displayMessage(parentComponent, message, windowTitle, JOptionPane.WARNING_MESSAGE);
IcongetIconWarning()
Retrieves the standard warning icon (the same one that JOptionPane uses).
return UIManager.getIcon("OptionPane.warningIcon");
voidmessageWarning(String s)
message Warning
JOptionPane.showMessageDialog(null, s, "Warning", JOptionPane.WARNING_MESSAGE);
voidmessageWarning(String s)
message Warning
JOptionPane.showMessageDialog(null, s, "Warning", JOptionPane.WARNING_MESSAGE);
voidpopupMessage(String title, String message, @SuppressWarnings("SameParameterValue") int icon)
Gives a popup to the user.
Canvas frame = new Canvas();
JOptionPane.showMessageDialog(frame, message, title, icon);
StringpopupPrompt(String title, String message, @SuppressWarnings("SameParameterValue") String[] choices, String defaultOption)
Allows the user to choose from a series of choices.
ImageIcon icon = new ImageIcon();
Canvas frame = new Canvas();
return (String) JOptionPane.showInputDialog(frame, message, title, JOptionPane.PLAIN_MESSAGE, icon, choices,
        defaultOption);
intshowPrettyWarningPromptPane(Component caller, String msg)
show Pretty Warning Prompt Pane
Object[] options = { "OK", "Cancel" };
int response = JOptionPane.showOptionDialog(null,
        "<html><body><p syle='width: 200px;'>" + msg + "</p></body></html>", "Warning",
        JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]);
return response;
voidshowWarning(Component owner, String msg)
Shows a warning dialog
showWarning(owner, "Warning", msg);
voidshowWarning(Component parent, String title, String message)
show Warning
JOptionPane.showMessageDialog(parent, message, title, JOptionPane.WARNING_MESSAGE);