home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-04-15 | 590 b | 29 lines |
- package com.next.gt;
-
- import java.awt.*;
- import java.awt.event.*;
-
- /**
- Utility class whose objects exit when the attached window is closed.
- */
- public class WindowDestroyer extends WindowAdapter {
-
- private Gamelication owner;
- private Frame mainScreen;
-
- public WindowDestroyer( Frame gamelicationFrame , Gamelication owner ) {
- mainScreen = gamelicationFrame;
- this.owner = owner;
- }
-
- public void windowClosing(WindowEvent e) {
- if( e.getWindow() == mainScreen ) {
- owner.stop();
- System.exit(0) ;
- }
- else
- e.getWindow().dispose();
- }
- }
-
-