A visible component is a canvas component that is painted onto a
graphics context. This interface contains a small set of methods
that are required by any such object. It is also used as a tagging
interface so that paint routines can tell whether certain objects
want to be painted or not.
Paint this object onto a 2D graphics object, within the given
region. Implementors should first test if the visibility flag is
set, and paint the object if it is. The provided region can be
used to optimize the paint, but implementors can assume that the
clip region is correctly set beforehand.
graphics2D - The 2D graphics object that this object
it to be painted upon.
region - The region.
void setVisible(boolean flag)
Set the visibility flag of this object. If the flag is false,
then the object will not be painted on the screen.