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

Graphics Parameters

The Graphics class fulfills two major responsibilities:

  • Set and get graphical parameters

  • Perform graphical operations in an output device

The main focus of attention for the Graphics class is the second item, to which most of this chapter is devoted. This section takes a brief look at the graphical parameters that are maintained by the Graphics class:

  • Color

  • Font and font metrics

  • Clipping rectangle

  • Graphics mode

The Graphics class provides get and set methods for color, font, and clipping rectangle. Graphics mode is a write-only property, while font metrics is a read-only property.[1]

[1] Font metrics are associated with a specific font, so font metrics can be changed by changing the Graphics' font.

Each Graphics maintains a single ...

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