// Create a star using a general path object
Polygon2D p = new Polygon2D.Double();
p.moveTo(-100.0f, -25.0f);
p.lineTo(+100.0f, -25.0f);
p.lineTo(-50.0f, +100.0f);
p.lineTo(+0.0f, -100.0f);
p.lineTo(+50.0f, +100.0f);
p.closePath();
// translate origin towards center of canvas