Java JOptionPane Message popupMessage(String title, String message)

Here you can find the source of popupMessage(String title, String message)

Description

Gives the user a popup message with no icon.

License

Open Source License

Declaration

public static void popupMessage(String title, String message) 

Method Source Code


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

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

public class Main {
    /**// w  w  w  .  j  a v  a  2  s.co 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. optionWindow(String message, String title, String[] options)
  2. pause(final String msg)
  3. plain(String title, Object message, JComponent parent)
  4. popup(Component parent, String message, String title)
  5. popupMessage(String message)
  6. promptForFloat(Component parentComponent, String message, String title, float oldValue)
  7. promptForString(Component parentComponent, String message, String title, String oldValue)
  8. queryBoolean(String message)
  9. queryDouble(String message, double initialValue)