1public class AdapterExample extends WindowAdapter{
2 Frame f;
3 AdapterExample(){
4 f=new Frame();
5 f.addWindowListener(this);
6
7 f.setSize(400,400);
8 f.setLayout(null);
9 f.setVisible(true);
10 }
11public void windowClosing(WindowEvent e) {
12 f.dispose();
13}
14public static void main(String[] args) {
15 new AdapterExample();
16}