I'm trying to replicate the ray-looking design, just like in the first image.
Here's my code:
When the user clicks on the button:
private class drawInnerShape implements ActionListener{
public void actionPerformed( ActionEvent e){
paintInnerDesign = true;
repaint();
}
}
The following code executes:
class DrawArtwork extends JPanel {
@Override
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
if(paintInnerDesign)
{
Color nextColor = new Color(255, 216, 0);
int arcEnd = 2;
for(int i = 0; i <= 89; i++)
{
g2d.setColor(nextColor);
g2d.fillArc((int) ((canvasWidth / 4) + 35), (int) (canvasHeight / 12) + 100, (int)(canvasHeight * .75), (int)(canvasHeight * .75), arcStart, arcEnd);
g2d.setColor(Color.BLACK);
g2d.fillArc((int) ((canvasWidth / 4) + 35), (int) (canvasHeight / 12) + 100, (int)(canvasHeight * .75), (int)(canvasHeight * .75), arcEnd, arcEnd + 2);
arcStart = arcStart + 4;
arcEnd = arcEnd + 4;
}
}
}
}
However, I'm getting the results in image two. And if I change i value from 89 to 79, I get the results in image three.
I can't figure out why it won't paint the object just like in the first image.