10.3. Paint Styles
When you fill a Shape, the Graphics2D object uses the settings associated with the internal Paint attribute. The Paint setting can be a Color (solid color), a GradientPaint (gradient fill gradually combining two colors), a TexturePaint (tiled image), or a new version of Paint that you write yourself. Use setPaint and get Paint to change and retrieve the Paint settings. Note that setPaint and getPaint supersede the setColor and getColor methods that were used in Graphics.
Arguments to the Graphics2D setPaint method (and return values of getPaint) must implement the Paint interface. Here are the major built-in Paint classes.
The Color class defines the same Color constants (Color.red, Color.yellow, etc.) as ...