Java Reference
In-Depth Information
CHAPTER
13
G
RAPHICS
Objectives
To draw graphics using the methods in the
Graphics
class (§13.2).
■
To override the
paintComponent
method to draw graphics on a GUI
component (§13.2).
■
To use a panel as a canvas to draw graphics (§13.2).
■
To draw strings, lines, rectangles, ovals, arcs, and polygons (§§13.3,
13.5-13.6).
■
To obtain font properties using
FontMetrics
and to display a text
centered in a panel (§13.7).
■
To display an image on a GUI component (§13.10).
■
To develop the reusable GUI components
FigurePanel
,
MessagePanel
,
StillClock
, and
ImageViewer
(§§13.4, 13.8,
13.9, 13.11).
■