Code, cooking, catman
this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose(); }});