// now we use the polygon and color class

import java.awt.*;
import java.applet.Applet;

public class DrawApplet extends Applet
{
	public int[] xpts = new int[1000];
	public int[] ypts = new int[1000];
	public int pointCt = 0;

	public void init() {
	}

	public boolean mouseDrag(Event e, int x, int y){

		xpts[pointCt]=x;
		ypts[pointCt]=y;
		pointCt=(pointCt+1)%1000;

		repaint();

		return true;
	}

	public void paint(Graphics g) {
		g.setColor(new Color(204,102,102));

		g.drawPolyline(xpts,ypts, pointCt);

		/*for(int i=0;i<pointCt;i++) {
			g.drawRect(xpts[i], ypts[i], 10, 10);
		}*/

	}

}
