summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Kreise.inc
blob: 2a413bff660529160efdefc8ec4e5a5d71438a54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Kreise.inc */

public void paint(Graphics g)
{
  int r = 8;
  int i, j;
  int x, y;

  for (i=1; i<=10; ++i) {
    x = 150 - r * i;
    y = (int) (40 + (i - 1) * 1.7321 * r);
    for (j=1; j<=i; ++j) {
      g.drawOval(x,y,2*r,2*r);
      x += 2 * r;
    }
  }
}