| Package | Description | 
|---|---|
| java.awt | Contains all of the classes for creating user
interfaces and for painting graphics and images. | 
| java.awt.font | Provides classes and interface relating to fonts. | 
| java.awt.image | Provides classes for creating and modifying 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.plaf.nimbus | Provides user interface objects built according to the cross-platform
Nimbus look and feel. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| Graphics2D | SplashScreen. createGraphics()Creates a graphics context (as a  Graphics2Dobject) for the splash
 screen overlay image, which allows you to draw over the splash screen. | |
| abstract Graphics2D | GraphicsEnvironment. createGraphics(BufferedImage img)Returns a  Graphics2Dobject for rendering into the
 specifiedBufferedImage. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | ImageGraphicAttribute. draw(Graphics2D graphics,
    float x,
    float y)Renders this  GraphicAttributeat the specified
 location. | |
| void | ShapeGraphicAttribute. draw(Graphics2D graphics,
    float x,
    float y)Renders this  GraphicAttributeat the specified
 location. | |
| void | TextLayout. draw(Graphics2D g2,
    float x,
    float y)Renders this  TextLayoutat the specified location in
 the specifiedGraphics2Dcontext. | |
| abstract void | GraphicAttribute. draw(Graphics2D graphics,
    float x,
    float y)Renders this  GraphicAttributeat the specified
 location. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| Graphics2D | BufferedImage. createGraphics()Creates a  Graphics2D, which can be used to draw into
 thisBufferedImage. | |
| abstract Graphics2D | VolatileImage. createGraphics()Creates a  Graphics2D, which can be used to draw into
 thisVolatileImage. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | Painter. paint(Graphics2D g,
     T object,
     int width,
     int height)Renders to the given  Graphics2Dobject. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| protected void | AbstractRegionPainter. configureGraphics(Graphics2D g)Configures the given Graphics2D. | |
| protected abstract void | AbstractRegionPainter. doPaint(Graphics2D g,
       JComponent c,
       int width,
       int height,
       Object[] extendedCacheKeys)Actually performs the painting operation. | |
| void | AbstractRegionPainter. paint(Graphics2D g,
     JComponent c,
     int w,
     int h)Renders to the given  Graphics2Dobject. | 
 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.