19.09.2015 Views

Prentice.Hall.Introduction.to.Java.Programming,.Brief.Version.9th.(2014).[sharethefiles.com]

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER<br />

13<br />

GRAPHICS<br />

Objectives<br />

■ To draw graphics using the methods in the Graphics class (§13.2).<br />

■<br />

To override the paintComponent method <strong>to</strong> draw graphics on a GUI<br />

<strong>com</strong>ponent (§13.2).<br />

■ To use a panel as a canvas <strong>to</strong> draw graphics (§13.2).<br />

■ To draw strings, lines, rectangles, ovals, arcs, and polygons (§§13.3,<br />

13.5–13.6).<br />

■<br />

To obtain font properties using FontMetrics and <strong>to</strong> display a text<br />

centered in a panel (§13.7).<br />

■ To display an image on a GUI <strong>com</strong>ponent (§13.10).<br />

■<br />

To develop the reusable GUI <strong>com</strong>ponents FigurePanel,<br />

MessagePanel, StillClock, and ImageViewer (§§13.4, 13.8,<br />

13.9, 13.11).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!