FileDocCategorySizeDatePackage
Choice1.javaAPI DocExample3260Mon Apr 06 18:10:22 BST 1998None

Choice1

public class Choice1 extends Applet

Fields Summary
String[]
description
TextField
t
Choice
c
Button
b
int
count
Constructors Summary
Methods Summary
public booleanaction(java.awt.Event evt, java.lang.Object arg)

    if(evt.target.equals(c))
      t.setText("index: " +  c.getSelectedIndex()
        + "   " + (String)arg);
    else if(evt.target.equals(b)) {
      if(count < description.length)
        c.addItem(description[count++]);
    } 
    else 
      return super.action(evt, arg);
    return true;
  
public voidinit()

     
    t.setEditable(false);
    for(int i = 0; i < 4; i++)
      c.addItem(description[count++]);
    add(t);
    add(c);
    add(b);