FileDocCategorySizeDatePackage
TextField1.javaAPI DocExample3219Mon Apr 06 18:10:22 BST 1998None

TextField1

public class TextField1 extends Applet

Fields Summary
Button
b1
Button
b2
TextField
t
String
s
Constructors Summary
Methods Summary
public booleanaction(java.awt.Event evt, java.lang.Object arg)

    if(evt.target.equals(b1)) {
      getAppletContext().showStatus(t.getText());
      s = t.getSelectedText();
      if(s.length() == 0) s = t.getText();
      t.setEditable(true);
    }
    else if(evt.target.equals(b2)) {
      t.setText("Inserted by Button 2: " + s);
      t.setEditable(false);
    }
    // Let the base class handle it:
    else 
      return super.action(evt, arg);
    return true; // We've handled it here
  
public voidinit()

     
    add(b1);
    add(b2);
    add(t);