Java JOptionPane Warning popupMessage(String title, String message, @SuppressWarnings("SameParameterValue") int icon)

Here you can find the source of popupMessage(String title, String message, @SuppressWarnings("SameParameterValue") int icon)

Description

Gives a popup to the user.

License

Open Source License

Parameter

Parameter Description
icon The icon. You can use some of the constants in JOptionPane for this.

Declaration

@SuppressWarnings("WeakerAccess")
public static void popupMessage(String title, String message,
        @SuppressWarnings("SameParameterValue") int icon) 

Method Source Code


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

import javax.swing.*;
import java.awt.*;

public class Main {
    /**/*from w w w .  ja v a 2s .c  o  m*/
     * Gives the user a popup message with no icon.
     */
    public static void popupMessage(String title, String message) {
        popupMessage(title, message, JOptionPane.PLAIN_MESSAGE);
    }

    /**
     * Gives a popup to the user.
     * @param icon The icon. You can use some of the constants in JOptionPane for this.
     */
    @SuppressWarnings("WeakerAccess")
    public static void popupMessage(String title, String message,
            @SuppressWarnings("SameParameterValue") int icon) {
        Canvas frame = new Canvas();
        JOptionPane.showMessageDialog(frame, message, title, icon);
    }
}

Related

  1. displayWarning(String strMsg)
  2. displayWarningMessage(Component parentComponent, String message, String windowTitle)
  3. getIconWarning()
  4. messageWarning(String s)
  5. messageWarning(String s)
  6. popupPrompt(String title, String message, @SuppressWarnings("SameParameterValue") String[] choices, String defaultOption)
  7. showPrettyWarningPromptPane(Component caller, String msg)
  8. showWarning(Component owner, String msg)
  9. showWarning(Component parent, String title, String message)