This program uses the motion of the mouse to animate the setting of the sun and the rising of the moon. It demonstrates the use of mutator methods, as well as the Color class. Also notice that in order to make the sun set, the 'move' method must be given a positive number.

Note: This demo requires a Java enabled browser. If you see this message then your browser either doesn't support Java or has had Java disabled.

Click below to download the source files for SunAndMoon.