When you fill a shape, its inside is covered with paint. Use the
setPaint method to set the paint style to an object with a class that implements the
Paint interface. The Java 2D API provides three such classes:
Color class implements the
Paint interface. To fill shapes with a solid color, simply call
setPaint with a
Color object, such as
GradientPaint class varies colors by interpolating between two given color values (see Figure 7.15).
TexturePaint class fills an area with repetitions of an image (see Figure 7.16).
You can construct ...