// Fig 5.2: ForCounter.java
// Counter-controlled repetition

// Java core packages
import java.awt.Graphics;

// Java extension packages
import javax.swing.JApplet;

public class ForCounter extends JApplet {
	
	//draw lines on the applet's backgrouns
	public void paint ( Graphics g )
	{
		//call inherited version of the method paint
		super.paint( g );
		
		/* Initialization, repetition condition, and incrimenting
		 are all included in the for structure header*/	
		for ( int counter = 1; counter <= 25; counter++ )
		
			g.drawLine( counter * 10, 250, 250, 250 - counter * 10 );
			//g.drawLine( 250, counter * 10, 250 + counter * 10, 250 );
			//g.drawLine( counter * 10, 250, 250, 250 + counter * 10 );
			//g.drawLine( 250, 250 + counter * 10, 500 - counter * 10, 250 );
		
	}	// end method paint
	
}	// end class WhileCounter