import java.applet.*;
import java.awt.*;
import javax.swing.*;
public class draw extends Applet
{
public void delay()
{
try
{
Thread.sleep(1); // do nothing for 1000 miliseconds (1 second)
}
catch(InterruptedException e)
{
e.printStackTrace();
}
}
public void paint(Graphics g)
{
//Timer delay = new Timer()
for(int i = 0; i < 255; i++)
{
delay();
Color myRed = new Color(i, 0, 0);
g.setColor(myRed);
g.fillRect(0,i,100,3);
}
for(int t = 0; t < 255; t++)
{
delay();
Color myGreen = new Color(0, t, 0);
g.setColor(myGreen);
g.drawRect(100,t,100,3);
}
for(int q= 0; q < 255; q++)
{
delay();
Color myBlue = new Color(0, 0, q);
g.setColor(myBlue);
g.fillRect(200,q,100,3);
}
}
}
JellyTurf 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.