7.17 (Optional) GUI and Graphics Case Study: Drawing Arcs
Using Java’s graphics features, we can create complex drawings that would be more tedious to code line by line. In Figs. 7.25–7.26, we use arrays and repetition statements to draw a rainbow by using Graphics
method fillArc
. Drawing arcs in Java is similar to drawing ovals—an arc is simply a section of an oval.
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.