This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color; | |
public class MovingRectangle { | |
/** | |
* method: showAnimation | |
* This method shows an animation in which a rectangle moves around, inside and close to | |
* the edges of an open window. | |
* Eveytime the rectangle changes the moving direction, its color is changed | |
* to the next color in the specified array. If there is no more color in the array, |