MessageDialog.java Source code

Java tutorial

Introduction

Here is the source code for MessageDialog.java

Source

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

public class MessageDialog {

    public static void main(String argv[]) {
        String message = "William Shakespeare was born\n" + "on April 23, 1564 in\n"
                + "Stratford-on-Avon near London.";
        JOptionPane pane = new JOptionPane(message);
        JDialog dialog = pane.createDialog(new JFrame(), "Dilaog");
        dialog.show();
    }
}