FileDocCategorySizeDatePackage
TextArea1.javaAPI DocExample3501Mon Apr 06 18:10:22 BST 1998None

TextArea1

public class TextArea1 extends Applet

Fields Summary
Button
b1
Button
b2
Button
b3
Button
b4
TextArea
t1
TextArea
t2
Constructors Summary
Methods Summary
public booleanaction(java.awt.Event evt, java.lang.Object arg)

    if(evt.target.equals(b1))
      getAppletContext().showStatus(t1.getText());
    else if(evt.target.equals(b2)) {
      t2.setText("Inserted by Button 2");
      t2.appendText(": " + t1.getText());
      getAppletContext().showStatus(t2.getText());
    }
    else if(evt.target.equals(b3)) {
      String s = " Replacement ";
      t2.replaceText(s, 3, 3 + s.length());
    }
    else if(evt.target.equals(b4))
      t2.insertText(" Inserted ", 10);
    // Let the base class handle it:
    else 
      return super.action(evt, arg);
    return true; // We've handled it here
  
public voidinit()

     
    add(b1);
    add(t1);
    add(b2);
    add(t2);
    add(b3);
    add(b4);