//windowCloser //makes it easier to attach window closing to a program import java.awt.*; import java.awt.event.*; public class WindowCloser extends WindowAdapter{ Window myOwner; WindowCloser(Object w){ myOwner = (Window) w; } // end constructor public void windowClosing(WindowEvent e){ myOwner.dispose(); System.exit(0); } // end windowClosing } // end class def