home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / Gamelication / com / next / gt / RCS / WindowDestroyer.java,v < prev   
Text File  |  1998-04-15  |  940b  |  69 lines

  1. head    1.2;
  2. access;
  3. symbols;
  4. locks; strict;
  5. comment    @# @;
  6.  
  7.  
  8. 1.2
  9. date    98.04.13.23.35.56;    author jgh8962;    state Exp;
  10. branches;
  11. next    1.1;
  12.  
  13. 1.1
  14. date    98.04.10.17.53.01;    author jgh8962;    state Exp;
  15. branches;
  16. next    ;
  17.  
  18.  
  19. desc
  20. @@
  21.  
  22.  
  23. 1.2
  24. log
  25. @*** empty log message ***
  26. @
  27. text
  28. @package com.next.gt;
  29.  
  30. import java.awt.*;
  31. import java.awt.event.*;
  32.  
  33. /**
  34.   Utility class whose objects exit when the attached window is closed.
  35.   */
  36. public class WindowDestroyer extends WindowAdapter {
  37.  
  38.     private Gamelication     owner;
  39.     private Frame        mainScreen;
  40.  
  41.     public WindowDestroyer( Frame gamelicationFrame , Gamelication owner ) {
  42.         mainScreen = gamelicationFrame;
  43.         this.owner = owner;
  44.     }
  45.     
  46.     public void windowClosing(WindowEvent e) {
  47.     if( e.getWindow() == mainScreen ) {
  48.         owner.stop();
  49.         System.exit(0) ;
  50.     }
  51.     else 
  52.         e.getWindow().dispose();
  53.     }
  54. }
  55.  
  56. @
  57.  
  58.  
  59. 1.1
  60. log
  61. @Initial revision
  62. @
  63. text
  64. @d20 6
  65. a25 2
  66.         owner.stop();
  67.     System.exit(0) ;
  68. @
  69.