make a subclass for WindowListener