Graphics and painting

(Chapter 12)

paint() methods

So, what can we DO in the paint() or paintComponent() methods? Pretty much anything that's available in the Graphics class, and then some.
 

class Graphics and other useful helper classes


Java2D

The Java2D API provides advanced graphics capabilities, for more detailed and complex two-dimensional drawing.

Java 2D API -- for an overview, see this page on the Java web site.

A Java-2D Tutorial

See the last two chapter 12 examples -- these illustrate some sample uses of Graphics2D methods draw() and fill(), along with some of the Java2D shape types and drawing options.

Deitel examples