FileDocCategorySizeDatePackage
MovingCircle.javaAPI DocExample817Fri Jul 28 13:32:28 BST 2000None

MovingCircle

public class MovingCircle extends Applet

Fields Summary
private int
xCoord
private int
yCoord
private int
width
private int
depth
Constructors Summary
Methods Summary
public voidpaint(java.awt.Graphics g)

 		// circle diameter
			

	     // this does the drawing
	

		g.setColor(Color.blue);		// set the pen colour blue
		g.fillOval(xCoord, yCoord, width, depth); // draw the rectangle
		g.drawString("Hello World", xCoord, yCoord + depth + 20); // write the string
		xCoord = xCoord + 20;		// move in 20 pixels from the left
		yCoord = yCoord + 20;		// move down 20 pixels from the top