Example usage for javax.swing JOptionPane INFORMATION_MESSAGE

List of usage examples for javax.swing JOptionPane INFORMATION_MESSAGE

Introduction

In this page you can find the example usage for javax.swing JOptionPane INFORMATION_MESSAGE.

Prototype

int INFORMATION_MESSAGE

To view the source code for javax.swing JOptionPane INFORMATION_MESSAGE.

Click Source Link

Document

Used for information messages.

Usage

From source file:Main.java

public static void showMessage(Window owner, String msg, String title) {
    JOptionPane.showMessageDialog(owner, msg, title, JOptionPane.INFORMATION_MESSAGE);
}

From source file:Main.java

public static void showMessage(String msg) {
    JOptionPane.showMessageDialog(null, msg, "Information", JOptionPane.INFORMATION_MESSAGE);
}

From source file:Main.java

/** Show an information message dialog box with message word wrapping. */
public static void informationMessageBox(Component parent, String caption, String message) {
    messageBox(parent, caption, JOptionPane.INFORMATION_MESSAGE, message);
}

From source file:Main.java

/**
 * Displays a {@link JOptionPane} as an information message.
 *
 * @param title The title of the dialog.
 * @param message The message inside the dialog.
 *//*  ww w  . j a va2 s. co  m*/
public static void showInformationMessage(String title, String message) {
    JOptionPane.showMessageDialog(null, message, title, JOptionPane.INFORMATION_MESSAGE);
}

From source file:Main.java

public static void showInfo(Component parent, String message) {
    Component cmp = new JScrollPane(new JTextArea(message));
    cmp.setPreferredSize(new Dimension(400, 400));
    JOptionPane.showMessageDialog(parent, cmp, "Information", JOptionPane.INFORMATION_MESSAGE);
}

From source file:Main.java

/**
 * Show input dialog with specified title and message.
 * //from w w  w. ja  v  a2s .c  o m
 * @param parent
 *            the parent component of the input dialog, set {@code null} if
 *            not has one
 * @param title
 *            the title of the dialog
 * @param message
 *            the message to display
 * @return the input string, may be an empty string
 */
public static String inputDialog(Component parent, String title, String message) {
    return JOptionPane.showInputDialog(parent, message, title, JOptionPane.INFORMATION_MESSAGE);
}

From source file:Main.java

/**
 * Show input dialog in item selection mode with specified title, message
 * and initial selection.// www . ja v a 2s .c o  m
 * 
 * @param parent
 *            the parent component of the input dialog, set {@code null} if
 *            not has one
 * @param title
 *            the title of the dialog
 * @param message
 *            the message to display
 * @param initial
 *            an array of <code>Object</code>s that
 *            gives the possible selections
 * @param selections
 *            the value used to initialize the input
 *            field
 * @return the selected item, or <code>null</code> if user canceled input.
 */
public static Object selectDialog(Component parent, String title, String message, Object initial,
        Object[] selections) {
    return JOptionPane.showInputDialog(parent, message, title, JOptionPane.INFORMATION_MESSAGE, null,
            selections, initial);
}

From source file:Main.java

/**
 * Show input dialog in item selection mode with specified title, message
 * and initial selection.//w ww  . j  a  va 2 s .c o  m
 * 
 * @param parent
 *            the parent component of the input dialog, set {@code null} if
 *            not has one
 * @param title
 *            the title of the dialog
 * @param message
 *            the message to display
 * @param initial
 *            an array of <code>Object</code>s that
 *            gives the possible selections
 * @param selections
 *            the value used to initialize the input
 *            field
 * @return the index of the selected item, or <code>-1</code> if user
 *         canceled input.
 */
public static int selectIndexDialog(Component parent, String title, String message, Object initial,
        Object[] selections) {
    Object obj = JOptionPane.showInputDialog(parent, message, title, JOptionPane.INFORMATION_MESSAGE, null,
            selections, initial);
    if (obj != null)
        for (int i = 0; i < selections.length; i++)
            if (obj.equals(selections[i]))
                return i;
    return -1;
}

From source file:Main.java

/**
 * Show an info window.//  ww  w.j a  v a  2s. com
 * @param message   The message to show.
 * @param parent   Parent component of this dialog.
 */
public static void info(String message, Component parent) {
    Toolkit.getDefaultToolkit().beep();
    JOptionPane.showMessageDialog(parent, message, "Info", JOptionPane.INFORMATION_MESSAGE);
}

From source file:Main.java

private void displayGUI() {
    JOptionPane.showMessageDialog(null, getPanel(), "Output : ", JOptionPane.INFORMATION_MESSAGE);
}