home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / earthlink / nscomm / java40.jar / java / awt / Window.class (.txt) < prev   
Encoding:
Java Class File  |  1997-11-03  |  1.8 KB  |  87 lines

  1. package java.awt;
  2.  
  3. import java.awt.peer.WindowPeer;
  4. import java.io.Serializable;
  5.  
  6. public class Window extends Container implements Serializable {
  7.    String warningString;
  8.  
  9.    Window() {
  10.       SecurityManager var1 = System.getSecurityManager();
  11.       if (var1 != null && !var1.checkTopLevelWindow(this)) {
  12.          this.warningString = System.getProperty("awt.appletWarning", "Warning: Applet Window");
  13.       }
  14.  
  15.    }
  16.  
  17.    public Window(Frame var1) {
  18.       SecurityManager var2 = System.getSecurityManager();
  19.       if (var2 != null && !var2.checkTopLevelWindow(this)) {
  20.          this.warningString = System.getProperty("awt.appletWarning", "Warning: Applet Window");
  21.       }
  22.  
  23.       super.parent = var1;
  24.       super.visible = false;
  25.       ((Container)this).setLayout(new BorderLayout());
  26.    }
  27.  
  28.    public synchronized void addNotify() {
  29.       if (super.peer == null) {
  30.          super.peer = this.getToolkit().createWindow(this);
  31.       }
  32.  
  33.       super.addNotify();
  34.    }
  35.  
  36.    public synchronized void pack() {
  37.       if (super.peer == null) {
  38.          this.addNotify();
  39.       }
  40.  
  41.       ((Component)this).resize(((Container)this).preferredSize());
  42.       ((Container)this).validate();
  43.    }
  44.  
  45.    public synchronized void show() {
  46.       if (super.peer == null) {
  47.          this.addNotify();
  48.       }
  49.  
  50.       ((Container)this).validate();
  51.       if (super.visible) {
  52.          this.toFront();
  53.       } else {
  54.          super.show();
  55.       }
  56.    }
  57.  
  58.    public synchronized void dispose() {
  59.       ((Component)this).hide();
  60.       ((Container)this).removeNotify();
  61.    }
  62.  
  63.    public void toFront() {
  64.       WindowPeer var1 = (WindowPeer)super.peer;
  65.       if (var1 != null) {
  66.          var1.toFront();
  67.       }
  68.  
  69.    }
  70.  
  71.    public void toBack() {
  72.       WindowPeer var1 = (WindowPeer)super.peer;
  73.       if (var1 != null) {
  74.          var1.toBack();
  75.       }
  76.  
  77.    }
  78.  
  79.    public Toolkit getToolkit() {
  80.       return Toolkit.getDefaultToolkit();
  81.    }
  82.  
  83.    public final String getWarningString() {
  84.       return this.warningString;
  85.    }
  86. }
  87.