Example usage for javax.swing JOptionPane WARNING_MESSAGE

List of usage examples for javax.swing JOptionPane WARNING_MESSAGE

Introduction

In this page you can find the example usage for javax.swing JOptionPane WARNING_MESSAGE.

Prototype

int WARNING_MESSAGE

To view the source code for javax.swing JOptionPane WARNING_MESSAGE.

Click Source Link

Document

Used for warning messages.

Usage

From source file:Main.java

public static void alert(String message) {
    JOptionPane.showMessageDialog(null, message, "Alert", JOptionPane.WARNING_MESSAGE);
}

From source file:Main.java

public static void alertWarning(String message) {
    JOptionPane.showMessageDialog(null, message, "Warning", JOptionPane.WARNING_MESSAGE);
}

From source file:Main.java

public static void showWarning(Window owner, String msg, String title) {
    JOptionPane.showMessageDialog(owner, msg, title, JOptionPane.WARNING_MESSAGE);
}

From source file:Main.java

public static void warning(String warningMessage) {
    JOptionPane.showMessageDialog(new JFrame(), warningMessage, "WARNING", JOptionPane.WARNING_MESSAGE);
}

From source file:Main.java

public static void showWarning(Component parent, String warnMessage) {
    JOptionPane.showMessageDialog(parent, warnMessage, "Warning", JOptionPane.WARNING_MESSAGE);
}

From source file:Main.java

public static boolean confirmAction(Component comp, String title, String msg) {
    int decision = JOptionPane.showConfirmDialog(comp, msg, title, JOptionPane.YES_NO_OPTION,
            JOptionPane.WARNING_MESSAGE);
    if (decision == JOptionPane.NO_OPTION) {
        return false;
    }/*from  w w  w.  j  av a2 s  .c  o m*/
    return true;
}

From source file:Main.java

/** Show a warning message dialog box with message word wrapping. */
public static void warningMessageBox(Component parent, String message) {
    messageBox(parent, "Warning", JOptionPane.WARNING_MESSAGE, message);
}

From source file:Main.java

/**
 * Displays a {@link JOptionPane} as a warning message.
 *
 * @param title The title of the dialog.
 * @param message The message inside the dialog.
 *//*  w ww.j a va  2s  .  c  om*/
public static void showWarningMessage(String title, String message) {
    JOptionPane.showMessageDialog(null, message, title, JOptionPane.WARNING_MESSAGE);
}

From source file:Main.java

public static boolean confirmOverwrite(Component comp, File file) {
    if (file.exists()) {
        int decision = JOptionPane.showConfirmDialog(comp, file.getName() + " exists. Overwrite?",
                "Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
        if (decision == JOptionPane.NO_OPTION) {
            return false;
        }/*from ww  w .  j av  a 2s.  co  m*/
    }
    return true;
}

From source file:Main.java

public static void showMessage(String message) {
    JOptionPane.showMessageDialog(null, message, "Warning", JOptionPane.WARNING_MESSAGE);
}