我试图得到一堆小圈有不同色调的绿色,在一个大圆圈内得到一个“布什”看,但我无法弄清楚如何获得所有的小圈子一个大圈的形状。我只能弄清楚如何把它放在一个矩形内。如何在圆圈内绘制圆形?
public void paintComponent(Graphics g)
{
super.paintComponent(g);
for(int i = 0; i < 1000; i++){
int redV = (int) ((Math.random() * 100) + 27);
g.setColor(new Color(red, red + 31, red - 15));
int x = (int) ((Math.random() * 400) + 150);
int y = (int) ((Math.random() * 500) + 200);
g.fillOval(x, y, 50, 50);
}
}
为了更快提供更好的帮助,请发布[SSCCE](http://sscce.org/)。 –