/* Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
This code is for educational purposes only. Use at own risk.*/

1. import java.awt.* ; 

2. import java.applet.* ; 

3.  

4. public class RepPaint 

5.     extends Applet 

6.

7.   public void init() 

8.   { 

9.     setBackground ( Color.blue ) ; 

10.   } 

11.    

12.   public void paint( Graphics gr ) 

13.   { 

14.     int x, y , count; 

15.     double r1 ; 

16.      

17.     gr.setColor ( Color.white ) ; 

18.  

19.     count = 0

20.     while ( count < 200

21.     { 

22.       r1 = Math.random() ; 

23.       r1 = r1 * 350

24.       x = (int) r1 ; 

25.       r1 = Math.random() ; 

26.       y = (int)(r1 * 200) ; 

27.        

28.       gr.fillOval ( x, y, 3, 3 ) ; 

29.       count++ ; 

30.     }            

31.   } 

32.