Section 13.2 Graphics Contexts and Graphics Objects

• A Java graphics context (p. 558) enables drawing on the screen.

• Class Graphics (p. 558) contains methods for drawing strings, lines, rectangles and other shapes. Methods are also included for font manipulation and color manipulation.

• A Graphics object manages a graphics context and draws pixels on the screen that represent text and other graphical objects, e.g., lines, ellipses, rectangles and other polygons (p. 558).

• Class Graphics is an abstract class. Each Java implementation has a Graphics subclass that provides drawing capabilities. This implementation is hidden from us by class Graphics, which supplies the interface that enables us to use graphics in a platform-independent manner. ...

Get Java™ How To Program (Early Objects), Tenth 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.