home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / main.bin / EnvironmentDialog.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-08-04  |  2.4 KB  |  84 lines

  1. package symantec.descfileconverter;
  2.  
  3. import java.awt.Button;
  4. import java.awt.Component;
  5. import java.awt.Container;
  6. import java.awt.Dialog;
  7. import java.awt.Event;
  8. import java.awt.Frame;
  9. import java.awt.Label;
  10. import java.awt.LayoutManager;
  11. import java.awt.Rectangle;
  12.  
  13. public class EnvironmentDialog extends Dialog {
  14.    Button button1;
  15.    Label osName;
  16.    Label javaVendor;
  17.    Label javaVersion;
  18.    Label label1;
  19.    Label label2;
  20.    Label label3;
  21.  
  22.    void button1_Clicked(Event var1) {
  23.       ((Component)this).hide();
  24.       ((Component)this).getParent().requestFocus();
  25.    }
  26.  
  27.    public EnvironmentDialog(Frame var1, boolean var2) {
  28.       super(var1, var2);
  29.       ((Container)this).setLayout((LayoutManager)null);
  30.       ((Dialog)this).addNotify();
  31.       ((Component)this).resize(((Container)this).insets().left + ((Container)this).insets().right + 250, ((Container)this).insets().top + ((Container)this).insets().bottom + 135);
  32.       this.button1 = new Button("OK");
  33.       this.button1.reshape(((Container)this).insets().left + 96, ((Container)this).insets().top + 96, 66, 27);
  34.       ((Container)this).add(this.button1);
  35.       this.osName = new Label("text");
  36.       this.osName.reshape(((Container)this).insets().left + 108, ((Container)this).insets().top + 12, 132, 17);
  37.       ((Container)this).add(this.osName);
  38.       this.javaVendor = new Label("text");
  39.       this.javaVendor.reshape(((Container)this).insets().left + 108, ((Container)this).insets().top + 36, 132, 17);
  40.       ((Container)this).add(this.javaVendor);
  41.       this.javaVersion = new Label("text");
  42.       this.javaVersion.reshape(((Container)this).insets().left + 108, ((Container)this).insets().top + 60, 132, 17);
  43.       ((Container)this).add(this.javaVersion);
  44.       this.label1 = new Label("OS Name:");
  45.       this.label1.reshape(((Container)this).insets().left + 24, ((Container)this).insets().top + 12, 72, 17);
  46.       ((Container)this).add(this.label1);
  47.       this.label2 = new Label("Java Vendor:");
  48.       this.label2.reshape(((Container)this).insets().left + 12, ((Container)this).insets().top + 36, 84, 17);
  49.       ((Container)this).add(this.label2);
  50.       this.label3 = new Label("Java Version:");
  51.       this.label3.reshape(((Container)this).insets().left + 12, ((Container)this).insets().top + 60, 84, 17);
  52.       ((Container)this).add(this.label3);
  53.       ((Dialog)this).setTitle("Environment");
  54.       ((Dialog)this).setResizable(false);
  55.       this.osName.setText(System.getProperty("os.name"));
  56.       this.javaVendor.setText(System.getProperty("java.vendor"));
  57.       this.javaVersion.setText(System.getProperty("java.version"));
  58.    }
  59.  
  60.    public EnvironmentDialog(Frame var1, String var2, boolean var3) {
  61.       this(var1, var3);
  62.       ((Dialog)this).setTitle(var2);
  63.    }
  64.  
  65.    public synchronized void show() {
  66.       Rectangle var1 = ((Component)this).getParent().bounds();
  67.       Rectangle var2 = ((Component)this).bounds();
  68.       ((Component)this).move(var1.x + (var1.width - var2.width) / 2, var1.y + (var1.height - var2.height) / 2);
  69.       super.show();
  70.    }
  71.  
  72.    public boolean handleEvent(Event var1) {
  73.       if (var1.id == 201) {
  74.          ((Component)this).hide();
  75.          return true;
  76.       } else if (var1.target == this.button1 && var1.id == 1001) {
  77.          this.button1_Clicked(var1);
  78.          return true;
  79.       } else {
  80.          return super.handleEvent(var1);
  81.       }
  82.    }
  83. }
  84.