import java.awt.*;

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

/** A custom Panel (borderless window) that
 *  reports where the mouse was clicked.
 */

public class MouseDownPanel extends Panel {
  private String name;

  public MouseDownPanel(String name, Color bgColor) {
    setBackground(bgColor);
    this.name = name;
    setLayout(null);
  }

  public boolean mouseDown(Event event, int x, int y) {
    System.out.println(name + ": mouse clicked at (" +
                       x + "," + y + ").");
    return(false); // Pass event to  containing window
  }
}

