Hey all !! I'm having a frustrating time trying to create a particular Java applet for a class.. I have no clue how to accomplish this, and really need HELP.. Anyone, PLEASE help me if you can, any help is appreciated the exact details are below:
I'm trying to create an applet that will draw 200 lines all of the same length starting from coordinate (0, 0) each with a random color.After drawing each line call the method Wait.holdOn(10) to let the next line is drawn after 10 nanoseconds. When all 100 lines are drawn then gradually clear the applet. That is drawing each line with the color of the background of the applet starting with the last line. Repeat the whole process five times (you need to put your code inside a for-loop which iterates 5 times).
Note: Include the class Wait.java in the folder of this program
Note: Random colors meaning every time you run the program we get a different color for the same line.
He's says to add the below class to this applet:
public class Wait{
public static void holdOn(long period){
try{
Thread.sleep(pe riod);
}catch(Exceptio n e){}
}
}
BELOW IS A PICTURE OF WHAT I'M TRYING TO ATTEMPT:
http://farm3.static.flickr.com/2744/...05f177bc_o.jpg
I'm trying to create an applet that will draw 200 lines all of the same length starting from coordinate (0, 0) each with a random color.After drawing each line call the method Wait.holdOn(10) to let the next line is drawn after 10 nanoseconds. When all 100 lines are drawn then gradually clear the applet. That is drawing each line with the color of the background of the applet starting with the last line. Repeat the whole process five times (you need to put your code inside a for-loop which iterates 5 times).
Note: Include the class Wait.java in the folder of this program
Note: Random colors meaning every time you run the program we get a different color for the same line.
He's says to add the below class to this applet:
public class Wait{
public static void holdOn(long period){
try{
Thread.sleep(pe riod);
}catch(Exceptio n e){}
}
}
BELOW IS A PICTURE OF WHAT I'M TRYING TO ATTEMPT:
http://farm3.static.flickr.com/2744/...05f177bc_o.jpg