// these are some of the basics of applets

import java.awt.*;
import java.applet.Applet;

public class HelloWorldObj extends Applet
{
	public HelloClass[] hellos = new HelloClass[100];
	public int numHellos;

	public void init() {
		System.out.println("Init");
	}

	public boolean mouseDown(Event e, int x, int y){
		System.out.println("mouseDown at " + x +  " " + y);

		hellos[numHellos] = new HelloClass(x, y);
		numHellos++;

		repaint();

		return true;
	}

	public void paint(Graphics g) {
		System.out.println("Paint");

		for(int i=0;i<numHellos;i++) {
			hellos[i].paint(g);
		}
	}
}

class HelloClass {

	public int xPos;
	public int yPos;

	public HelloClass(int x, int y) {
		xPos = x;
		yPos = y;
	}

	public void paint(Graphics g) {
		g.drawString("Hello World!", xPos, yPos);
	}

}
