Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class Main {
    public static void main() {
        Frame frame = new Frame();
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent evt) {
                Frame frame = (Frame) evt.getSource();
                frame.setVisible(false);
                // frame.dispose();
            }
        });
    }
}