Java JOptionPane Error showErrorMsg(final Container parent, final String message)

Here you can find the source of showErrorMsg(final Container parent, final String message)

Description

show Error Msg

License

Apache License

Declaration

public static void showErrorMsg(final Container parent, final String message) throws HeadlessException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.Container;

import java.awt.HeadlessException;

import javax.swing.JOptionPane;

import javax.swing.SwingUtilities;

import javax.swing.UIManager;

public class Main {
    public static void showErrorMsg(final Container parent, final String message) throws HeadlessException {
        SwingUtilities.invokeLater(new Runnable() {

            @Override//from  w ww . j  ava  2s . c om
            public void run() {
                JOptionPane.showMessageDialog(parent, message, UIManager.getString("OptionPane.messageDialogTitle"),
                        JOptionPane.ERROR_MESSAGE);
            }
        });
    }
}

Related

  1. showErrorMessage(String message)
  2. showErrorMessage(String message, Component component)
  3. showErrorMessage(String message, int errorCode)
  4. showErrorMessage(String msg)
  5. showErrorMessage(String title, String message, java.awt.Component parent)
  6. showErrorPane(String errorMessage, Exception e)
  7. showErrorPanel(Component parent, String aS, Icon icon)
  8. showNoMacFoundError()
  9. showPrettyErrorPane(Component caller, String msg)