While loop
int i = 0;
int x = 20, y=20;
int x2 = x + 80;
while ( i < 5 ) {
   g.drawLine(x, y, x2, y);
   y=y+10;  // go to next line
   i++;    // i = i+ 1
}