Setting the Clipping Area with a Shape g2d.setClip(shape); drawGraphics(g2d);