O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

The AWT provides two color models: index color models and direct color models. Index color models interpret pixel values as indices into a colormap, whereas direct color models directly interpret the bits in a pixel value.

Colors are represented by the java.awt.Color class, which provides a set of constants for commonly used colors, in addition to convenience methods for obtaining darker and lighter shades of a color, comparing two colors for equality, etc.

Fonts are represented by the java.awt.Font class, which allows the construction of fonts by specifying a logical font name, style, and point size. Logical font names are always mapped onto native fonts so, for instance, a SanSerif logical name will map to different fonts on different ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required