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

voidshowWarning(final Component rootComponent, final String message, final String title)
show Warning
JOptionPane.showMessageDialog(rootComponent, message, title, JOptionPane.WARNING_MESSAGE);
voidshowWarning(final String message)
show Warning
if (EventQueue.isDispatchThread()) {
    JOptionPane.showMessageDialog(null, message, "Warning", JOptionPane.WARNING_MESSAGE);
} else {
    try {
        EventQueue.invokeAndWait(new Runnable() {
            public void run() {
                JOptionPane.showMessageDialog(null, message, "Warning", JOptionPane.WARNING_MESSAGE);
        });
    } catch (InterruptedException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
voidshowWarning(String message)
Display a simple warning message in a dialog box.
JOptionPane.showMessageDialog(null, message, "Warning", JOptionPane.WARNING_MESSAGE);
voidshowWarning(String message)
show Warning
JOptionPane.showMessageDialog(new JDialog(), message, "Warning", JOptionPane.WARNING_MESSAGE);
voidshowWarningBox(Component pParent, String pMessage, String pTitle)
show Warning Box
JOptionPane.showMessageDialog(pParent, pMessage, pTitle, JOptionPane.WARNING_MESSAGE);
intshowWarningConfirmBox(Component pParent, String pMessage, String pTitle, String pLeftOption, String pRightOption)
show Warning Confirm Box
UIManager.put("OptionPane.noButtonText", pLeftOption);
UIManager.put("OptionPane.yesButtonText", pRightOption);
int result = JOptionPane.showConfirmDialog(pParent, pMessage, pTitle, JOptionPane.YES_NO_OPTION,
        JOptionPane.WARNING_MESSAGE);
UIManager.put("OptionPane.noButtonText", "No");
UIManager.put("OptionPane.yesButtonText", "Yes");
return result;
voidshowWarningMessage(Component parent, String str)
Display warning message.
JOptionPane.showMessageDialog(parent, str, "Warning!", JOptionPane.WARNING_MESSAGE);
voidshowWarningMessage(Component parent, String str)
Show warning message.
JOptionPane.showMessageDialog(parent, str, "Warning!", JOptionPane.WARNING_MESSAGE);
voidshowWarningMessage(final Window aParent, final String aMessage)
Convenience method to show a warning message.
JOptionPane.showMessageDialog(aParent, aMessage, "Warning ...", JOptionPane.WARNING_MESSAGE);
voidshowWarningMessage(String message, Component component)
show Warning Message
JOptionPane.showMessageDialog(component, message, "Peringatan", JOptionPane.WARNING_MESSAGE);