FileDocCategorySizeDatePackage
aroundWindow.javaAPI DocExample1471Tue Aug 08 17:09:28 BST 2000None

aroundWindow

public class aroundWindow extends Applet

Fields Summary
private int
movement
private int
circleXPosition
private int
circleYPosition
Constructors Summary
Methods Summary
public voidpaint(java.awt.Graphics g)

	
	   	// this does the drawing
	
		g.setColor(Color.green) ;
		
		// move circle along the top of the window
		circleYPosition = 0 ;
		for (circleXPosition = 0 ; circleXPosition <= 240 ; circleXPosition += movement)
		{
			g.drawOval(circleXPosition,circleYPosition,60,60) ;
		}
		
		// move circle along the right edge of the window
		circleXPosition = 240 ;
		for (circleYPosition = 0 ; circleYPosition <= 240 ; circleYPosition += movement)
		{
			g.drawOval(circleXPosition,circleYPosition,60,60) ;
		}
		
		// move circle along the bottom of the window
		circleYPosition = 240 ;
		for (circleXPosition = 240 ; circleXPosition >= 0 ; circleXPosition -= movement)
		{
			g.drawOval(circleXPosition,circleYPosition,60,60) ;
		}
		
		// move circle along the left edge of the window
		circleXPosition = 0 ;
		for (circleYPosition = 240 ; circleYPosition > 0 ; circleYPosition -= movement)
		{
			g.drawOval(circleXPosition,circleYPosition,60,60) ;
		}