home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-07-20 | 6.0 KB | 239 lines |
- /**
- *
- * You can add code anywhere in this file - except in the areas that are
- * written by the editor. You should not change the relative ordering of
- * the code.
- *
- * You can remove this comment block or replace it with another.
- *
- * @see
- * @version
- * @author
- */
-
-
- import com.supercede.forms.*;
- import java.util.*;
- import java.net.*;
- import java.io.*;
- import java.beans.*;
- import java.awt.event.*;
- import java.awt.*;
-
- public class Form1 extends SuperCedeFrame implements Serializable
- {
-
- public Form1() throws IOException, ClassNotFoundException, ClassCastException, SuperCedeInvalidStateException
- {
- SuperCedeConstructor(); // Do not remove this line.
- }
-
- public static void main(String args[])
- {
- // You can add code anywhere in this method.
-
- try
- {
- Form1 app = new Form1();
- app.setVisible(true);
- }
- catch(Throwable t)
- {
- System.out.println("Cannot construct the form: " + t);
- System.exit(1);
- }
- }
-
- public void form1WindowClosing(WindowEvent e)
- {
- // You can add code anywhere in this method.
-
- dispose();
- }
-
- public void form1WindowClosed(WindowEvent e)
- {
- // You can add code anywhere in this method.
-
- SuperCedeWindowClosed();
- }
-
- public void inputFieldActionPerformed(ActionEvent arg0)
- {
- // Put event handler code here...
- myTextArea.append(inputField.getText()+"\n");
- inputField.selectAll();
- inputField.requestFocus();
- }
-
- public void addButtonActionPerformed(ActionEvent arg0)
- {
- // Put event handler code here...
- myTextArea.append(inputField.getText()+"\n");
- inputField.selectAll();
- inputField.requestFocus();
- }
-
- public void clearButtonActionPerformed(ActionEvent arg0)
- {
- // Put event handler code here...
- myTextArea.setText("");
- inputField.requestFocus();
- }
-
- // SuperCede Begin 2.0 Form Members
- // Do not remove the Begin and End markers.
- // The editor will rewrite the contents of this section each time the form is saved.
-
- // References to Beans within the Form.
-
- TextField inputField;
- Button addButton;
- Button clearButton;
- com.supercede.beans.stdawt.TextAreaSB myTextArea;
-
- private final void SuperCedeConstructor() throws IOException, ClassNotFoundException, ClassCastException, SuperCedeInvalidStateException
- {
- // Construct the actual connectors to give to our base class.
-
- Vector connectors = new Vector(5);
- connectors.addElement(new Form1WindowClosingConnector0());
- connectors.addElement(new Form1WindowClosedConnector1());
- connectors.addElement(new Form1EventConnector3());
- connectors.addElement(new Form1EventConnector4());
- connectors.addElement(new Form1EventConnector5());
-
- super.initializeThis(connectors);
-
- // Make references to Beans within the Form.
-
- int i = 0;
-
- inputField = (TextField) getComponent(i++);
- addButton = (Button) getComponent(i++);
- clearButton = (Button) getComponent(i++);
- myTextArea = (com.supercede.beans.stdawt.TextAreaSB) getComponent(i++);
- }
-
- private final void SuperCedeWindowClosed()
- {
- System.exit(0);
- }
-
- // SuperCede End 2.0 Form Members
- }
-
- // SuperCede Begin 2.0 Form Connectors
- // Do not remove the Begin and End markers.
- // The editor will rewrite the contents of this section each time the form is saved.
-
- // Connections for this Form:
- // Form1WindowClosingConnector0: from Form1.windowClosing to Form1.form1WindowClosing
- // Form1WindowClosedConnector1: from Form1.windowClosed to Form1.form1WindowClosed
- // Form1EventConnector3: from java.awt.TextField.actionPerformed to Form1.inputFieldActionPerformed
- // Form1EventConnector4: from java.awt.Button.actionPerformed to Form1.addButtonActionPerformed
- // Form1EventConnector5: from java.awt.Button.actionPerformed to Form1.clearButtonActionPerformed
-
- final class Form1WindowClosingConnector0 extends WindowAdapter implements SuperCedeConnector
- {
- private Form1 windowClosingTarget;
-
- public void setWindowClosingTarget(Form1 target)
- {
- windowClosingTarget = target;
- }
-
- public void windowClosing(WindowEvent arg0)
- {
- windowClosingTarget.form1WindowClosing(arg0);
- }
-
- public void setTarget(Object target)
- {
- setWindowClosingTarget((Form1) target);
- }
- }
-
- final class Form1WindowClosedConnector1 extends WindowAdapter implements SuperCedeConnector
- {
- private Form1 windowClosedTarget;
-
- public void setWindowClosedTarget(Form1 target)
- {
- windowClosedTarget = target;
- }
-
- public void windowClosed(WindowEvent arg0)
- {
- windowClosedTarget.form1WindowClosed(arg0);
- }
-
- public void setTarget(Object target)
- {
- setWindowClosedTarget((Form1) target);
- }
- }
-
- final class Form1EventConnector3 implements SuperCedeConnector, java.awt.event.ActionListener
- {
- private Form1 actionPerformedTarget;
-
- public void setActionPerformedTarget(Form1 target)
- {
- actionPerformedTarget = target;
- }
-
- public void actionPerformed(ActionEvent arg0)
- {
- actionPerformedTarget.inputFieldActionPerformed(arg0);
- }
-
- public void setTarget(Object target)
- {
- setActionPerformedTarget((Form1) target);
- }
- }
-
- final class Form1EventConnector4 implements SuperCedeConnector, java.awt.event.ActionListener
- {
- private Form1 actionPerformedTarget;
-
- public void setActionPerformedTarget(Form1 target)
- {
- actionPerformedTarget = target;
- }
-
- public void actionPerformed(ActionEvent arg0)
- {
- actionPerformedTarget.addButtonActionPerformed(arg0);
- }
-
- public void setTarget(Object target)
- {
- setActionPerformedTarget((Form1) target);
- }
- }
-
- final class Form1EventConnector5 implements SuperCedeConnector, java.awt.event.ActionListener
- {
- private Form1 actionPerformedTarget;
-
- public void setActionPerformedTarget(Form1 target)
- {
- actionPerformedTarget = target;
- }
-
- public void actionPerformed(ActionEvent arg0)
- {
- actionPerformedTarget.clearButtonActionPerformed(arg0);
- }
-
- public void setTarget(Object target)
- {
- setActionPerformedTarget((Form1) target);
- }
- }
-
- // The following line must be the last line in the file.
- // SuperCede End 2.0 Form Connectors
-