Java JOptionPane Warning showWarning(Component owner, String msg)

Here you can find the source of showWarning(Component owner, String msg)

Description

Shows a warning dialog

License

Open Source License

Parameter

Parameter Description
owner a parameter
msg a parameter

Declaration

public static void showWarning(Component owner, String msg) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Component;

import javax.swing.JOptionPane;

public class Main {
    /**//  w w w .  j  av  a  2s . c  o m
     * Shows a warning dialog
     *
     * @param owner
     * @param title
     * @param msg
     */
    public static void showWarning(Component owner, String title, String msg) {
        JOptionPane.showMessageDialog(owner, msg, title, JOptionPane.WARNING_MESSAGE);
    }

    /**
     * Shows a warning dialog
     *
     * @param owner
     * @param msg
     */
    public static void showWarning(Component owner, String msg) {
        showWarning(owner, "Warning", msg);
    }

    /**
     * Shows a warning dialog
     *
     * @param msg
     */
    public static void showWarning(String msg) {
        showWarning(null, msg);
    }
}

Related

  1. messageWarning(String s)
  2. messageWarning(String s)
  3. popupMessage(String title, String message, @SuppressWarnings("SameParameterValue") int icon)
  4. popupPrompt(String title, String message, @SuppressWarnings("SameParameterValue") String[] choices, String defaultOption)
  5. showPrettyWarningPromptPane(Component caller, String msg)
  6. showWarning(Component parent, String title, String message)
  7. showWarning(final Component rootComponent, final String message, final String title)
  8. showWarning(final String message)
  9. showWarning(String message)