Hello. I am just starting java and I was woundering if anyone could help me with 2 things. I was woundering how to put my program into a loop so it just keeps going and how to make the circles transparent. Here is the program. Thank you very much if you help me.
import java.awt.*;
import java.applet.*;
import java.util.Random;
import java.awt.Color;
public class BackGround extends Applet {
public void init() {
}
public void paint(Graphics g)
{
Random rnd = new Random();
int randomR1 = rnd.nextInt(220) + 15;
int randomR2 = rnd.nextInt(220) + 15;
int randomR3 = rnd.nextInt(220) + 15;
int randomG1 = rnd.nextInt(220) + 15;
int randomG2 = rnd.nextInt(220) + 15;
int randomG3 = rnd.nextInt(220) + 15;
int randomB1 = rnd.nextInt(220) + 15;
int randomB2 = rnd.nextInt(220) + 15;
int randomB3 = rnd.nextInt(220) + 15;
int randomX1 = rnd.nextInt(450) + 25;
int randomX2 = rnd.nextInt(450) + 25;
int randomX3 = rnd.nextInt(450) + 25;
int randomY1 = rnd.nextInt(450) + 25;
int randomY2 = rnd.nextInt(450) + 25;
int randomY3 = rnd.nextInt(450) + 25;
Color randomColor1 = new Color( randomR1, randomG1, randomB1);
Color randomColor2 = new Color( randomR2, randomG2, randomB2);
Color randomColor3 = new Color( randomR3, randomG3, randomB3);
g.setColor(randomColor1);
g.fillOval(randomX1, randomY1, 80, 80);
g.setColor(randomColor2);
g.fillOval(randomX2, randomY1, 80, 80);
g.setColor(randomColor3);
g.fillOval(randomX3, randomY3, 80, 80);
}
}