/* MouseDown1 is a simple demonstration of the mouseDown() method. */ import java.awt.*; import java.applet.*; public class MouseDown1 extends Applet { int x; int y; public void init() { setBackground(Color.yellow); } public boolean mouseDown(Event evt, int x, int y) { this.x = x; this.y = y; repaint(); // request to be repainted return true; } public void paint(Graphics g) { g.drawString("(" + x + "," + y + ")", x, y); } }