Java 2D[tm] API: Datasheet


The Java 2D TM API extends the Java TM core APIs with enhanced 2D graphics and imaging capabilities.

  • Manages simple and complex drawing operations within a simple, consistent rendering model
  • Protects the investment in existing programs by compatibly extending java.awt and java.awt.image packages
  • Provides comprehensive text and font support and a rich set of imaging, transformation, compositing, and blending features
  • Enables consistent, accurate color reproduction
  • Is device and resolution-independent

The Java 2D API (Java 2D) is a set of classes that extend the capabilities of Sun's Abstract Windowing Toolkit (AWT). Java 2D handles arbitrary shapes, text, and images and allows all of these to be rotated, scaled, skewed, and otherwise transformed in a uniform manner. By leveraging the inherent strengths of Java technology, Java 2D brings the concept of "Write Once, Run Anywhere TM " to applications that require enhanced 2D graphics and imaging capabilities. As a result, developers are easily able to incorporate high-quality, scalable and platform-independent graphics into Java based applets and applications.

Because Java 2D extends the AWT hierarchy, existing programs will continue to work. And even new Java programs can compatibly mix both new and existing classes. In addition, as one of the Java Media APIs, Java 2D can help provide an ideal platform for creating enterprise-scale Java applications and applets that take full advantage of rich media to enhance communications.

Demonstration of image processing

Image processing using an edge detection convolution filter

Alpha blending of graphics over an image  Antialiased, bidirectional, rotated text
Magnification of Alpha belnding of graphics over image Magnification of antialiased bidirectional, rotated text

Simple, Extensible Architecture

Java 2D consists of a set of interfaces and base classes which provide the foundation for extensibility. This structure allows developers to manage simple and complex drawing operations with the same basic framework. This simple architecture also keeps the core classes stable and compact as new functionality is added, while facilitating code sharing and minimizing the number of concepts the developer must master.

Consistent Rendering Model

The Java 2D rendering model enables high-quality, device-independent graphics and allows client applications to use the same imaging model for both screen and print.

Leverages AWT Classes

Java 2D compatibly extends java.awt. Therefore, developers do not need to change the structure of their programs to use Java 2D since it follows the same programming model as existing classes in the java.awt and java.awt.image packages.

Comprehensive Text Handling

The Java 2D classes supports text handling that ranges from the simple use of fonts to professional-quality handling of character layout and font features.

Image Processing and Enhancement

Java 2D supplements the image-handling classes in the java.awt.image package, providing an array of image processing and display features. These features include image rescaling, thresholding, computing, manipulating lookup tables, and channel combining. These capabilities are useful in contrast filtering, high- and low-pass filtering, image sharpening and enhancement.

Color Imaging

Java 2D makes color reproduction simple yet empowers developers to make sophisticated use of high-quality color output. Java 2D also helps solve the consistency and accuracy problems of device-dependent color descriptions such as RGB and CMYK. For example, Java 2D allows you to create images in color spaces other than RGB color, and allows you to characterize colors for more accurate reproduction.

For More Information

For more information on Java Media APIs and how they can enable you to transform your ideas into innovative software solutions, see the Java 2D API homepage.

All information contained in this document is subject to change.
All Java Media API specifications have been developed in cooperation
with leading technology partners.

Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
Java 8 banner (182)