import java.awt.*;
import java.awt.event.*;

// This appears in Core Web Programming from
// Prentice Hall Publishers, and may be freely used
// or adapted. 1997 Marty Hall, hall@apl.jhu.edu.

/** Whenever an item is activated, it is displayed
 *  in the textfield that was supplied to the
 *  ActionReporter constructor
 */

public class ActionReporter implements ActionListener {
  private TextField actionField;

  public ActionReporter(TextField actionField) {
    this.actionField = actionField;
  }

  public void actionPerformed(ActionEvent event) {
    List source = (List)event.getSource();
    actionField.setText(source.getSelectedItem());
  }
}

