Fonts and Colors

Fonts and colors are important attributes of JFC programs. Fonts give text an aesthetic quality and make it easier to read. Colors offer excitement and information. Without color, images would be dull and warning messages would be harder to convey. Because of their importance, Java simplifies the task of working with fonts and colors.

Getting to Know Fonts

Fonts are nothing more than sets of type. Each font has a size and face (style). Size is measured in points (units of type that are approximately 1/72 of an inch). Faces include Bold, Italic, Bold and Italic, or neither Bold nor Italic (Plain). When a program draws text, this text always appears in a specific font.

A font is given a face name that identifies its typographic ...

Get Special Edition Using Java 2 Standard Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.