| Package | Description | 
|---|---|
| java.awt | Contains all of the classes for creating user
interfaces and for painting graphics and images. | 
| javax.swing | Provides a set of "lightweight"
(all-Java language) components that,
to the maximum degree possible, work the same on all platforms. | 
| javax.swing.border | Provides classes and interface for drawing
specialized borders around a Swing component. | 
| javax.swing.plaf | Provides one interface and many abstract classes that
Swing uses to provide its pluggable look-and-feel capabilities. | 
| Modifier and Type | Class | Description | 
|---|---|---|
| class  | ColorThe  Colorclass is used to encapsulate colors in the default
 sRGB color space or colors in arbitrary color spaces identified by aColorSpace. | |
| class  | GradientPaintThe  GradientPaintclass provides a way to fill
 aShapewith a linear color gradient pattern. | |
| class  | LinearGradientPaintThe  LinearGradientPaintclass provides a way to fill
 aShapewith a linear color gradient pattern. | |
| class  | MultipleGradientPaintThis is the superclass for Paints which use a multiple color
 gradient to fill in their raster. | |
| class  | RadialGradientPaintThe  RadialGradientPaintclass provides a way to fill a shape with
 a circular radial color gradient pattern. | |
| class  | SystemColorA class to encapsulate symbolic colors representing the color of
 native GUI objects on a system. | |
| class  | TexturePaintThe  TexturePaintclass provides a way to fill aShapewith a texture that is specified as
 aBufferedImage. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| abstract Paint | Graphics2D. getPaint()Returns the current  Paintof theGraphics2Dcontext. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| abstract void | Graphics2D. setPaint(Paint paint)Sets the  Paintattribute for theGraphics2Dcontext. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| static Border | BorderFactory. createDashedBorder(Paint paint)Creates a dashed border of the specified  paint. | |
| static Border | BorderFactory. createDashedBorder(Paint paint,
                  float length,
                  float spacing)Creates a dashed border of the specified  paint,
 relativelength, and relativespacing. | |
| static Border | BorderFactory. createDashedBorder(Paint paint,
                  float thickness,
                  float length,
                  float spacing,
                  boolean rounded)Creates a dashed border of the specified  paint,thickness,
 line shape, relativelength, and relativespacing. | |
| static Border | BorderFactory. createStrokeBorder(BasicStroke stroke,
                  Paint paint)Creates a border of the specified  strokeandpaint. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| Paint | StrokeBorder. getPaint()Returns the  Paintobject used to generate a color
 during the border rendering. | 
| Constructor | Description | 
|---|---|
| StrokeBorder(BasicStroke stroke,
            Paint paint)Creates a border of the specified  strokeandpaint. | 
| Modifier and Type | Class | Description | 
|---|---|---|
| class  | ColorUIResource | 
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.