Cover Page by Rogers Cadenhead

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Day 13. Creating Java2D Graphics

Today, you work with Java classes that put the graphics in graphical user interface. Java2D is a set of classes that support high-quality, scalable, two-dimensional images, color, and text.

Java2D, which includes classes in the java.awt and javax.swing packages, can be used for each of these visually appealing tasks:

• Drawing text

• Drawing shapes such as circles and polygons

• Using different fonts, colors, and line widths

• Filling shapes with colors and patterns

The Graphics2D Class

Everything in Java2D begins with the Graphics2D class in the java.awt package, which represents a graphics context, an environment in which something can be drawn. A Graphics2D object can represent a component on a graphical user ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required