Java Lab 2 Question 3
This page builds on the HelloAnim applet provided in the
Lecture.
- Changing the sleep time to 200 milliseconds slows the animation down
to half it's original speed as expected. Other values vary the speed
accordingly.
- The applet moves the text in the y-direction in additon to the x-direction.
It calculates these movements so that it will always start in the upper right
and move to the lower left corner. It does this for all input sizes.
- The animation only runs when the mouse is within it's window. This is
done with the suspend and resume methods on the thread object.
- Hello World is displayed in the center of the screen at startup.
The output of this applet is as follows:
Applet Source