Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JRootPane;

public class Main extends JFrame {

    public Main() {
        setTitle("like JDialog");
        setSize(new Dimension(500, 100));
        setUndecorated(true);
        setResizable(false);
        getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        new Main().setVisible(true);
    }
}