Hi , i was just wondering how you would produce a time delay in java. Bascically all im trying to do is draw a circle in a bunch of random places. Just draw circles way to fast. Here my code
import java.awt.*;
import hsa.Console;
public class Delay
{
static Console c;
public static void main (String[] args)
{
c = new Console ();
design();
}
static public void design () // randomly draws circles over HSA Console
{
int up = 0;
int x ;
int y;
int height;
int width ;
for (int counter = 0 ;; counter ++ ) // need to waste time between each
{ // for statement repetion
x = (int) (Math.random () * 500);
y = (int) (Math.random () * 500);
height = (int) (Math.random () * 100 );
width = (int) (Math.random () * 100 );
c.setColor (Color.red);
c.drawOval (x,y,height,width);
delay (10000);
}
}
public void delay (int howLong) // delay function to waste time
{
for (int i = 1 ; i <= howLong ; i++)
{
double garbage = Math.PI * Math.PI;
}
}
}