FileDocCategorySizeDatePackage
lotteryNos.javaAPI DocExample1597Thu Mar 22 11:48:00 GMT 2001None

LotteryNos

public class LotteryNos extends Applet

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

		circleXPosition = 1 ;	// set position of first circle
		circleYPosition = 20 ;
		textXPosition = 12 ;		// set position of text
		textYPosition = 42 ;
	
		// define and int, count, and initialise it to 1. Repeat the for 
		// loop until count = 7, and increment count by one for each time
		// round the loop.	
	
		// for loop in here
		{
			lotteryNumber  = (int) (Math.random() * 49) + 1; // get a value for the lottery number
	
			// draw a circle in which to display the lottery number
			g.setColor(Color.blue) ;
			g.drawOval(circleXPosition,circleYPosition,33,33) ;
			
			// write the lottery number
			g.setColor(Color.red);
			g.drawString("" + lotteryNumber, textXPosition, textYPosition);
			
			// increment position coordinates

			// position increment code here	
	
		}