Note: (Restricted functionality due to obvious reasons!)
Minimal Code ( Raw-View ) :
import java.awt.*;
import java.applet.*;
/*
<applet code="Spiral.class" height="250" width="300">
</applet>
*/
public class Spiral extends Applet implements Runnable
{
public void run()
{
}
public void paint(Graphics g)
{
g.setColor(Color.red);
g.drawString("-By DJ",10,20); //drawString(String, x-pos, y-pos)
g.setColor(Color.blue);
Thread th = new Thread(new Spiral());
try
{
th.sleep(1000);
}
catch(Exception e)
{
g.drawString("Error",10,50); //drawString(String, x-pos, y-pos)
}
int startAngle = 0, stopAngle=startAngle+90, st=0;
int w=10, h=10, x=110, y=100;
int quad =1;
for(int sta=stopAngle; sta<=1440; sta=sta+90)
{
if(quad == 1)
x -= 10;
if(quad == 2)
{x -= 5;}
if(quad == 3)
{y -=5;}
if(quad == 4)
{y -= 10;x -=5;quad =0;}
quad++;
//g.drawRect(x,y,w,h);
g.drawArc(x,y,w,h,st,90);
startAngle = sta;
st=(sta%360);
w += 10;
h += 10;
try
{
th.sleep(100);
}
catch(Exception e)
{
g.drawString("Error",10,50); //drawString(String, x-pos, y-pos)
}
}
}
}