i see.. do u use NetBeans IDE?
compile this class and drag it to your workarea, see what happens.
import java.awt.Graphics;
import java.awt.Polygon;
import javax.swing.JComponent;
public class MyShape extends JComponent{
@Override
public void paint(Graphics g) {
Polygon p = new Polygon();
p.addPoint(50, 0);
p.addPoint(0, 50);
p.addPoint(50, 100);
p.addPoint(100, 50);
g.drawPolygon(p);
}
}
if you compiled it and dragged to ur workarea, it will create a diamond shape. use that as a sample to create the shape u wanted. hope that helped.