import java.applet.*;
import java.awt.*;
public class Circle extends Applet implements Runnable
{
String s="";
int x,y,a,b,c;
public void init()
{
s = "ramila";
}
public void start()
{
Thread t = new Thread(this);
t.start();
}
public void run()
{
try
{
repaint();
}catch(Exception e)
{
System.out.println(e);
}
}
public void paint(Graphics g)
{
try{
for(int i=0;i<100;i++)
{
x = (int)(Math.random() *800);
y = (int)(Math.random() *600);
a = (int)(Math.random()*255);
b = (int)(Math.random()*255);
c = (int)(Math.random()*255);
g.setColor(new Color(a,b,c));
g.fillOval(x,y,50,50);
Thread.sleep(50);
}
}catch(Exception e){}
}
}
/*
<applet code ="Circle" height ="400" width ="500">
</applet>
*/
import java.awt.*;
public class Circle extends Applet implements Runnable
{
String s="";
int x,y,a,b,c;
public void init()
{
s = "ramila";
}
public void start()
{
Thread t = new Thread(this);
t.start();
}
public void run()
{
try
{
repaint();
}catch(Exception e)
{
System.out.println(e);
}
}
public void paint(Graphics g)
{
try{
for(int i=0;i<100;i++)
{
x = (int)(Math.random() *800);
y = (int)(Math.random() *600);
a = (int)(Math.random()*255);
b = (int)(Math.random()*255);
c = (int)(Math.random()*255);
g.setColor(new Color(a,b,c));
g.fillOval(x,y,50,50);
Thread.sleep(50);
}
}catch(Exception e){}
}
}
/*
<applet code ="Circle" height ="400" width ="500">
</applet>
*/
No comments:
Post a Comment