Newer
Older
myNWP / src / j7 / Test.java
@Motoki Miura Motoki Miura on 15 Sep 2021 543 bytes Simple Window
package j7;

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

import javax.swing.JButton;
import javax.swing.JFrame;

public class Test extends JFrame {
    public static void main(String[] args) {
        Test t = new Test();
        t.getContentPane().add(new JButton("hoge"));
        t.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
        t.pack();
        t.setVisible(true);
    }
}