Java JOptionPane Warning warningMessage(final String title, final String content)

Here you can find the source of warningMessage(final String title, final String content)

Description

Displays a warning message.

License

Apache License

Parameter

Parameter Description
title the title of the window
content the content of the warning

Declaration

public static void warningMessage(final String title, final String content) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (C) 2009, 2015, Danilo Pianini and contributors
 * listed in the project's build.gradle or pom.xml file.
 *
 * This file is distributed under the terms of the Apache License, version 2.0
 *******************************************************************************/

import javax.swing.JOptionPane;

import javax.swing.SwingUtilities;

public class Main {
    /**/* ww  w. jav  a  2  s. co  m*/
     * Displays a warning message.
     * 
     * @param title
     *            the title of the window
     * @param content
     *            the content of the warning
     */
    public static void warningMessage(final String title, final String content) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                JOptionPane.showMessageDialog(null, title, content, JOptionPane.WARNING_MESSAGE);
            }
        });
    }
}

Related

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