// Program 15.6: A Revised Event Tutor
import java.applet.Applet;
import java.awt.List;
import java.awt.Event;
import java.awt.Graphics;
              
public class EventList extends Applet {

  List theList; 

  public void init() {
    theList = new List(25, false);
    add(theList);
    theList.addItem("init event");
  }
  
  public void paint(Graphics g) {
    theList.addItem("paint event");
  }
    
  public void start() {
    theList.addItem("start event");
    repaint();
  }
 
  public void destroy() {
    theList.addItem("destroy event");
  }
 
  public void update(Graphics g) {
    theList.addItem("update event");
  }
  
  public boolean mouseUp(Event e, int x, int y) {
    theList.addItem("mouseUp at (" + x + "," + y + ")");
    return false;
  }
  
  public boolean mouseDown(Event e, int x, int y) {
    theList.addItem("mouseDown at (" + x + "," + y + ")");
    return false;
  }
  
  public boolean mouseDrag(Event e, int x, int y) {
    theList.addItem("mouseDrag at (" + x + "," + y + ")");
    return false;
  }
  
  public boolean mouseMove(Event e, int x, int y) {
   theList.addItem("mouseMove event at (" + x + "," + y + ")");
   return false;
  }
  
  public boolean mouseEnter(Event e, int x, int y) {
    theList.addItem("mouseEnter at (" + x + "," + y + ")");
    return false;
  }
  
 public boolean mouseExit(Event e, int x, int y) {
    theList.addItem("mouseExit at (" + x + "," + y + ")");
    return false;
  }
  
  public boolean keyDown(Event e, int x) {
    theList.addItem("keyDown: " + (char) x);
    return false;
  }
  
}
