Practical-2 Draw ten red circles in a vertical column in the center of the applet.
import java.applet.*;
import java.awt.*;
public class Practical2 extends Applet
{
public void paint(Graphics g)
{
g.setColor(Color.red);
int x=230,y=0;
for(int i=1;i<=10;i++)
{
g.fillOval(x, y, 40, 40);
y=y+50;
}
}
}
Output:
Comments
Post a Comment