/**
 * @(#)CreatingRandomNumber.java
 *
 * CreatingRandomNumber Applet application
 *
 * @author
 * @version 1.00 2011/2/10
 */

import java.awt.*;
import javax.swing.*;
import java.util.Random;

public class CreatingRandomNumber extends JApplet {
     Random random = new Random();

    public void init() {
    }
    
    // method generates random radius (just decleared)
    public int getRandomRadius()
    {
        Random random = new Random();
        int radius = random.nextInt(20000)+1;
    //  radius = (int) Math.random();
        //radius = (int) (Math.random()*50+1);
        return radius;// do not forget


    }


    public void paint(Graphics g) {

        super.paint(g);

        int radius;
        Color randomColor, customColor;
        customColor= new Color (23, 167, 23);
//      randomColor= new Color ((int)(Math.random()*255),
//                              (int)(Math.random()*255),
//                              (int)(Math.random()*255));
 randomColor = new Color(random.nextInt(255),
                            random.nextInt(255),
                            random.nextInt(255));
 




        g.setColor(customColor);
        g.drawString("Random Circles!", 150, 160 );


        //drawing first circle
        g.setColor(randomColor);
        radius = getRandomRadius();////method call for method I have to write
        g.drawString("Radius = "+radius, 180, 180 );
        g.drawOval(150, 200, radius *2, radius *2);

          //drawing second circle
        g.setColor(customColor);
        radius = getRandomRadius();//method call for method I have to write
        g.drawString("Radius = "+radius, 180, 200 );
        g.drawOval(150, 200, radius *2, radius *2);



    }//end paint


    
}