Graphics2D drawing methods
Since Graphics2D is a subclass of Graphics, all the previous drawing methods are still there: g2d.drawRect ( . . . ), g2d.fillRect ( . . . ), etc.
The new methods for drawing shapes are: g2d.draw ( shape );which uses the current Stroke for the boundary line. g2d.fill ( shape );which uses the current Paint for the fill of the shape.
There are also new methods for changing the origin of the drawing: g2d.translate ( x0, y0 ); g2d.rotate ( angleinradians );This enables each shape ( on previous slide ) to be defined with respect to its own (0, 0) origin.