13.5 Drawing Lines, Rectangles and Ovals

This section presents Graphics methods for drawing lines, rectangles and ovals. The methods and their parameters are summarized in Fig. 13.17. For each drawing method that requires a width and height parameter, the width and height must be nonnegative values. Otherwise, the shape will not display.

Image
Image

Fig. 13.17 | Graphics methods that draw lines, rectangles and ovals.

The application of Figs. 13.1813.19 demonstrates drawing a variety of lines, rectangles, three-dimensional rectangles, rounded rectangles ...

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.