// Fig 5.1: WhileCounter.java
// Counter-controlled repetition

// Java core packages
import java.awt.Graphics;

// Java extrnsion packages
import javax.swing.JApplet;

public class WhileCounter extends JApplet 
{
	//draw lines on the applet's backgrouns
	public void paint ( Graphics g )
	{
		//call inherited version of the method paint
		super.paint( g );
		
		int counter = 1;		// initialization
		
		while ( counter <= 25 )	//repetition condition
		{
			g.drawLine( 10, counter * 10, counter * 10, 250 );
			g.drawLine( counter * 10, 10, 250, counter * 10 );
			++counter;			// increment
		}	// end while structure
	}	// end method paint
}	// end class WhileCounter