home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Java / Gamelicator / examples / Boinkaroids / com / next / gt / WindowDestroyer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-20  |  798 b   |  25 lines

  1. package com.next.gt;
  2.  
  3. import java.awt.Frame;
  4. import java.awt.event.WindowAdapter;
  5. import java.awt.event.WindowEvent;
  6.  
  7. public class WindowDestroyer extends WindowAdapter {
  8.    private Gamelication owner;
  9.    private Frame mainScreen;
  10.  
  11.    public WindowDestroyer(Frame var1, Gamelication var2) {
  12.       this.mainScreen = var1;
  13.       this.owner = var2;
  14.    }
  15.  
  16.    public void windowClosing(WindowEvent var1) {
  17.       if (var1.getWindow() == this.mainScreen) {
  18.          this.owner.stop();
  19.          System.exit(0);
  20.       } else {
  21.          var1.getWindow().dispose();
  22.       }
  23.    }
  24. }
  25.