Java JOptionPane Message showMessage(String msg)

Here you can find the source of showMessage(String msg)

Description

Displays a message in a dialog box.

License

Open Source License

Declaration

public static void showMessage(String msg) 

Method Source Code

//package com.java2s;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

public class Main {
    /**//from  w  w w. j  av  a 2s  . co m
     * Displays a message in a dialog box.
     */
    public static void showMessage(String msg) {

        // internal error will be thrown if we try to create a frame
        // when running and no display is available.
        try {
            JFrame f = new JFrame();
            JOptionPane.showMessageDialog(f, msg, "Repast Message", JOptionPane.INFORMATION_MESSAGE);
            f.dispose();
        } catch (InternalError ex) {
            System.out.println("Repast Message: " + msg);
        }
    }
}

Related

  1. showMessage(String message)
  2. showMessage(String message)
  3. showMessage(String message, String title)
  4. showMessage(String message, String title)
  5. showMessage(String msg)
  6. showMessage(String msg)
  7. showMessage(String msg)
  8. showMessage(String title, String message)
  9. showMessage(String title, String message, java.awt.Component parent)