Summary

You now have some tools to improve the looks of an applet. You can draw with lines, rectangles, ellipses, polygons, fonts, colors, and patterns onto a frame, an applet window, and other components using non-2D and 2D classes.

Non-2D drawing operations require the use of methods in the Graphics class, with arguments that describe the object being drawn.

Java2D uses the same two methods for each drawing operation—draw() and fill(). Different objects are created using classes of the java.awt.geom package, and these are used as arguments for the drawing methods of Graphics2D.

You get more chances to work with multimedia in Java in Day 13, "Threads and Animation." Those art lessons include animation, sound, and the display of image files.

Get Sams Teach Yourself Java 2 in 21 Days, Second 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.