import java.applet.Applet;
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.

/** Draw circles centered where the user clicks. */

public class Circles extends Applet {
  public void init() {
    MouseListener circleListener =
      // An inner class. 
      new MouseAdapter() {
        public void mouseClicked(MouseEvent event) {
          getGraphics().fillOval(event.getX()-25,
                                 event.getY()-25,
                                 50, 50);
        }
    };

    // Attach the class just defined to the Applet.
    addMouseListener(circleListener);
  }
}
