Runtime
int x = 20, y=20;
int x2 = x + 80;
int height = this.getHeight();
int num_lines = (height – 40) / 10;
for (int i =0;  i < num_lines ; i++ ) {
   g.drawLine(x, y, x2, y);
   y=y+10;
}