package myprojects.java01;
import java.awt.*;
import java.awt.event.*;
class Java01 extends Frame {
public Java01()
{
addWindowListener
(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.out.println(e);
dispose();
System.exit(0);
}
});
}
public static void main(String args[]) {
Java01 mainFrame = new Java01();
mainFrame.setSize(400, 400);
mainFrame.setTitle("Java01");
mainFrame.setVisible(true);
}
}