import java.awt.*;
import java.awt.event.*;
class Test1 extends Frame implements WindowListener {
public static void main(String[] args) {
Test1 test1 = new Test1();
}
public Test1() {
this.setTitle("TestForm");
this.setSize(100,100);
this.setVisible(true);
this.addWindowListener(this);
}
public void windowActivated(WindowEvent e) {
}
public void windowDeactivated(WindowEvent e) {
}
public void windowClosed(WindowEvent e) {
System.exit(0);
}
public void windowClosing(WindowEvent e) {
dispose();
}
public void windowOpened(WindowEvent e) {
}
public void windowIconified(WindowEvent e) {
}
public void windowDeiconified(WindowEvent e) {
}
} |