Section 13.8 Java 2D API

• The Java 2D API (p. 581) provides advanced two-dimensional graphics capabilities.

• Class Graphics2D (p. 581)—a subclass of Graphics—is used for drawing with the Java 2D API.

• The Java 2D API’s classes for drawing shapes include Line2D.Double, Rectangle2D.Double, RoundRectangle2D.Double, Arc2D.Double and Ellipse2D.Double (p. 581).

• Class GradientPaint (p. 584) helps draw a shape in gradually changing colors—called a gradient (p. 584).

Graphics2D method fill (p. 584) draws a filled object of any type that implements interface Shape (p. 584).

• Class BasicStroke (p. 584) helps specify the drawing characteristics of lines.

Graphics2D method draw (p. 584) is used to draw a Shape object.

• Classes GradientPaint (p. ...

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.