GeneralPath path = new GeneralPath(); path.append(new Rectangle(...), false); path.append(new Triangle(...), false); g2.draw(path);