Java JOptionPane Warning warnMsg(final String msg)

Here you can find the source of warnMsg(final String msg)

Description

Warning message dialog

License

Open Source License

Parameter

Parameter Description
msg a parameter

Declaration

public static void warnMsg(final String msg) 

Method Source Code

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

import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;

public class Main {
    /**//from  w ww .  j av  a2s  .  com
     * Warning message dialog
     * 
     * @param msg
     */
    public static void warnMsg(final String msg) {
        // Show it in a message box
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                JOptionPane.showMessageDialog(null, msg, "Warning", JOptionPane.WARNING_MESSAGE);
                System.out.println(msg);
            }
        });
    }
}

Related

  1. warning(String Msg)
  2. warning(String msg)
  3. warning(String title, Object message, JComponent parent)
  4. warningMessage(Component component, String title, String message)
  5. warningMessage(final String title, final String content)
  6. warnMsg(String msg)
  7. warnUser(Component parent, String message)