MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JOptionPane;

public class MainClass {

    public static void main(String[] a) {
        JOptionPane optionPane = new JOptionPane();
        optionPane.setMessage("Set Message");
        optionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE);
        optionPane.setOptions(new Object[] { new JButton("Button") });
        JDialog dialog = optionPane.createDialog(null, "Icon/Text Button");
        dialog.setVisible(true);
    }
}