/*
  Disegna dei punti, sulla base del click del mouse
*/

import java.awt.*;

public class PuntiMouseDue extends java.applet.Applet {
  int xvett[] = new int[100];
  int yvett[] = new int[100];
  int npunti=0;

  public boolean mouseDown(Event e, int x, int y) {
    Graphics g=getGraphics();

    g.fillRect(x-2,y-2,4,4);

    xvett[npunti]=x;
    yvett[npunti]=y;
    npunti=npunti+1;

    return true;
  }

  public void paint(Graphics g) {
    int i;

    for(i=0; i<=npunti-1; i++) 
      g.fillRect(xvett[i]-2,yvett[i]-2,4,4);
  }
}
