home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / WDETOUR.BIN / Email.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-03-11  |  5.7 KB  |  212 lines

  1. import java.applet.Applet;
  2. import java.awt.Button;
  3. import java.awt.Checkbox;
  4. import java.awt.CheckboxGroup;
  5. import java.awt.Color;
  6. import java.awt.Component;
  7. import java.awt.Container;
  8. import java.awt.Event;
  9. import java.awt.Font;
  10. import java.awt.Label;
  11. import java.awt.LayoutManager;
  12. import java.awt.TextArea;
  13. import java.awt.TextField;
  14. import java.awt.event.ActionEvent;
  15. import java.beans.PropertyVetoException;
  16. import symantec.itools.awt.WrappingLabel;
  17. import symantec.itools.lang.Context;
  18. import symantec.itools.util.Timer;
  19.  
  20. public class Email extends Applet {
  21.    Timer timer1;
  22.    Label label1;
  23.    TextField textField1;
  24.    Label label2;
  25.    TextField textField2;
  26.    Label label3;
  27.    TextField textField3;
  28.    Label label4;
  29.    TextField textField4;
  30.    Label label5;
  31.    TextField textField5;
  32.    Label label6;
  33.    TextField textField6;
  34.    Label label7;
  35.    TextField textField7;
  36.    Label label8;
  37.    TextField textField8;
  38.    Label label9;
  39.    TextField textField9;
  40.    Label label10;
  41.    Checkbox radioButton1;
  42.    CheckboxGroup One;
  43.    Checkbox radioButton2;
  44.    Checkbox radioButton3;
  45.    Label label11;
  46.    TextArea textArea1;
  47.    Label label12;
  48.    TextArea textArea2;
  49.    Button button1;
  50.    Button button2;
  51.    WrappingLabel wrappingLabel1;
  52.  
  53.    void Email_GotFocus(Event event) {
  54.       this.textField7.setText("");
  55.    }
  56.  
  57.    void timer1_TimerEvent(ActionEvent event) {
  58.       this.wrappingLabel1.hide();
  59.       this.textField1.setText("");
  60.       this.textField2.setText("");
  61.       this.textField3.setText("");
  62.       this.textField4.setText("");
  63.       this.textField5.setText("");
  64.       this.textField6.setText("");
  65.       this.textField7.setText("");
  66.       this.textField8.setText("");
  67.       this.textField9.setText("");
  68.       this.textArea1.setText("");
  69.       this.textArea2.setText("");
  70.       this.radioButton1.setState(true);
  71.    }
  72.  
  73.    void button2_Clicked(ActionEvent event) {
  74.       this.timer1.start();
  75.       this.wrappingLabel1.show();
  76.    }
  77.  
  78.    void button1_Clicked(ActionEvent event) {
  79.       this.textField1.setText("");
  80.       this.textField2.setText("");
  81.       this.textField3.setText("");
  82.       this.textField4.setText("");
  83.       this.textField5.setText("");
  84.       this.textField6.setText("");
  85.       this.textField7.setText("");
  86.       this.textField8.setText("");
  87.       this.textField9.setText("");
  88.       this.textArea1.setText("");
  89.       this.textArea2.setText("");
  90.       this.radioButton1.setState(true);
  91.    }
  92.  
  93.    public void addNotify() {
  94.       super.addNotify();
  95.       Context.setDocumentBase(((Applet)this).getDocumentBase());
  96.       ((Container)this).setLayout((LayoutManager)null);
  97.       ((Component)this).setSize(503, 753);
  98.       ((Component)this).setFont(new Font("Dialog", 0, 12));
  99.       ((Component)this).setForeground(new Color(0));
  100.       ((Component)this).setBackground(new Color(16777215));
  101.       this.timer1 = new Timer(1000, false);
  102.       this.label1 = new Label("Name");
  103.       this.label1.setBounds(0, 8, 120, 28);
  104.       ((Container)this).add(this.label1);
  105.       this.textField1 = new TextField();
  106.       this.textField1.setBounds(128, 8, 349, 30);
  107.       ((Container)this).add(this.textField1);
  108.       this.label2 = new Label("Address");
  109.       this.label2.setBounds(0, 48, 120, 28);
  110.       ((Container)this).add(this.label2);
  111.       this.textField2 = new TextField();
  112.       this.textField2.setBounds(128, 48, 349, 30);
  113.       ((Container)this).add(this.textField2);
  114.       this.label3 = new Label("City/Town");
  115.       this.label3.setBounds(0, 88, 120, 28);
  116.       ((Container)this).add(this.label3);
  117.       this.textField3 = new TextField();
  118.       this.textField3.setBounds(128, 88, 349, 30);
  119.       ((Container)this).add(this.textField3);
  120.       this.label4 = new Label("State/County");
  121.       this.label4.setBounds(0, 128, 120, 28);
  122.       ((Container)this).add(this.label4);
  123.       this.textField4 = new TextField();
  124.       this.textField4.setBounds(128, 128, 349, 30);
  125.       ((Container)this).add(this.textField4);
  126.       this.label5 = new Label("Country Code");
  127.       this.label5.setBounds(0, 168, 120, 28);
  128.       ((Container)this).add(this.label5);
  129.       this.textField5 = new TextField();
  130.       this.textField5.setBounds(128, 168, 349, 30);
  131.       ((Container)this).add(this.textField5);
  132.       this.label6 = new Label("Zip Code/Postcode");
  133.       this.label6.setBounds(0, 208, 128, 28);
  134.       ((Container)this).add(this.label6);
  135.       this.textField6 = new TextField();
  136.       this.textField6.setBounds(128, 208, 349, 30);
  137.       ((Container)this).add(this.textField6);
  138.       this.label7 = new Label("Telephone");
  139.       this.label7.setBounds(0, 248, 120, 28);
  140.       ((Container)this).add(this.label7);
  141.       this.textField7 = new TextField();
  142.       this.textField7.setBounds(128, 248, 349, 30);
  143.       ((Container)this).add(this.textField7);
  144.       this.label8 = new Label("Fax");
  145.       this.label8.setBounds(0, 288, 120, 28);
  146.       ((Container)this).add(this.label8);
  147.       this.textField8 = new TextField();
  148.       this.textField8.setBounds(128, 288, 349, 30);
  149.       ((Container)this).add(this.textField8);
  150.       this.label9 = new Label("E-mail");
  151.       this.label9.setBounds(0, 328, 120, 28);
  152.       ((Container)this).add(this.label9);
  153.       this.textField9 = new TextField();
  154.       this.textField9.setBounds(128, 328, 349, 30);
  155.       ((Container)this).add(this.textField9);
  156.       this.label10 = new Label("What types of tours are you interested in?");
  157.       this.label10.setBounds(0, 368, 476, 35);
  158.       ((Container)this).add(this.label10);
  159.       this.One = new CheckboxGroup();
  160.       this.radioButton1 = new Checkbox("Custom", this.One, true);
  161.       this.radioButton1.setBounds(16, 400, 88, 32);
  162.       ((Container)this).add(this.radioButton1);
  163.       this.radioButton2 = new Checkbox("Package", this.One, false);
  164.       this.radioButton2.setBounds(120, 400, 88, 32);
  165.       ((Container)this).add(this.radioButton2);
  166.       this.radioButton3 = new Checkbox("Both", this.One, false);
  167.       this.radioButton3.setBounds(224, 400, 88, 32);
  168.       ((Container)this).add(this.radioButton3);
  169.       this.label11 = new Label("How did you find out about us?");
  170.       this.label11.setBounds(0, 432, 476, 27);
  171.       ((Container)this).add(this.label11);
  172.       this.textArea1 = new TextArea();
  173.       this.textArea1.setBounds(16, 464, 469, 64);
  174.       ((Container)this).add(this.textArea1);
  175.       this.label12 = new Label("Do you have any other comments?");
  176.       this.label12.setBounds(0, 536, 476, 26);
  177.       ((Container)this).add(this.label12);
  178.       this.textArea2 = new TextArea();
  179.       this.textArea2.setBounds(16, 568, 469, 64);
  180.       ((Container)this).add(this.textArea2);
  181.       this.button1 = new Button();
  182.       this.button1.setLabel("Clear");
  183.       this.button1.setBounds(144, 648, 102, 31);
  184.       this.button1.setBackground(new Color(12632256));
  185.       ((Container)this).add(this.button1);
  186.       this.button2 = new Button();
  187.       this.button2.setLabel("Submit Request");
  188.       this.button2.setBounds(256, 648, 102, 31);
  189.       this.button2.setBackground(new Color(12632256));
  190.       ((Container)this).add(this.button2);
  191.       this.wrappingLabel1 = new WrappingLabel();
  192.  
  193.       try {
  194.          this.wrappingLabel1.setText("Submitting request... (Simulated)");
  195.       } catch (PropertyVetoException var3) {
  196.       }
  197.  
  198.       try {
  199.          this.wrappingLabel1.setAlignStyle(1);
  200.       } catch (PropertyVetoException var2) {
  201.       }
  202.  
  203.       this.wrappingLabel1.setVisible(false);
  204.       this.wrappingLabel1.setBounds(160, 688, 184, 40);
  205.       ((Container)this).add(this.wrappingLabel1);
  206.       Email$Action lAction = new Email$Action(this);
  207.       this.button1.addActionListener(lAction);
  208.       this.button2.addActionListener(lAction);
  209.       this.timer1.addActionListener(lAction);
  210.    }
  211. }
  212.