O'Reilly logo

Special Edition Using Java 2 Standard Edition by Geoff Friesen, Chuck Cavaness, Brian Keeton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Shapes, Text, and Buffered Images

Now that you've seen how Java 2D improves on the AWT's rendering model, it's time to explore Java 2D's shapes, text enhancements, and buffered images.

Shapes

From a mathematical perspective, shapes are geometric entities (such as circles and rectangles). From Java's perspective, shapes are objects whose classes implement the Shape interface.

Graphics declares a variety of methods (such as drawArc and fillArc) for drawing and filling various kinds of shapes. The problem with these methods is that they don't represent shapes in an object-oriented manner. Although they might draw and fill shapes, it's not possible to, say, create an Arc object describing an arc and then call draw (Arc) to render its outline. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required