Summary

Unlike some object-oriented graphical toolkits, the AWT does not provide classes for specific shapes, such as Line and Circle classes. Instead, each AWT component comes with a Graphics object that is used to perform graphical operations in the component. In addition to components, other output devices, such as printers and offscreen images, also have associated Graphics for performing graphical operations.

java.awt.Graphics provides a wealth of methods for drawing and filling shapes, drawing text, and setting graphical parameters such as the color and font used for the next rendering operation. However, in some respects Graphics are quite limited—for instance, the pen used for drawing is restricted in size to a one-pixel square. The Java ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.