The problem is that after drawing rectangle i have circle in the center of bigger circle which is created by outside side of 18 Rectangles.in this problem left bottom corner of this 18 rectangles must be common, and no space between rectangle in center. How can i remove this space. it must be drawn by drawPolygon function. Thanks for HELP and sorry for my english!
import java.awt.*;
import javax.swing.*;
public class Rect20degreeRotate extends JApplet{
public void init() {
resize(500,500);
Container DrawArea = getContentPane();
DrawArea.add(
new JPanel(){
public void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
int x[]={10,40,40,10};
int y[]={10,10,20,20};
g2.translate( 100, 100);
for (int i=0;i<18;i++){
g2.rotate(20.0 * Math.PI / 180.0);
g2.drawPolygon(x,y,4);
}
}
}
);
}
}
}