Skip to content

Instantly share code, notes, and snippets.

View nhanb's full-sized avatar

Nhân nhanb

View GitHub Profile
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,