hi all you guys out there!
Im trying to solve this que, and its kind of bothering me..........I hate applets:(
- Write a program to draw n number of randomly generated circles on the applet where n is accepted as a parameter.
i did this but i dnt know how i can "randomly" generate them
thanks and i hope that you guys can help me out!!
outofmymind
Im trying to solve this que, and its kind of bothering me..........I hate applets:(
- Write a program to draw n number of randomly generated circles on the applet where n is accepted as a parameter.
i did this but i dnt know how i can "randomly" generate them
Code:
import java.applet.Applet;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Graphics;
public class circles extends Applet{
public void init(){
// setting the applet size
setSize(85,200);
// setting the background color on applet panel
this.setBackground(Color.WHITE);
// setting the layout on applet panel
setLayout(new FlowLayout());
}
public void paint(Graphics g){
g.drawOval(100,100,60,60);
//g.drawOval(100,100,60,60);
}
}
outofmymind
Comment