I have text file that has multiple x and y coordinates. I'm reding them in and trying to send them to drawrect. The problem I'm having is that the drawRect will only draw the last x and y that is read in here is how I'm reading in.
for (int i=0; i<4; i++){
tln = strLine.substring(mRec,mRec+18);
x1 = Integer.parseInt(tln.substring(1,3));
y1 = Integer.parseInt(tln.substring(3,6));
x2 = Integer.parseInt(tln.substring(6,9));
y2 = Integer.parseInt(tln.substring(9,12));
dim1 = Integer.parseInt(tln.substring(12,14));
flag = tln.substring(14,15);
lPoint = Integer.parseInt(tln.substring(15,17));
lSec = " ";
System.out.println(tln);
System.out.println(x1);
System.out.println(y1);
System.out.println(x2);
System.out.println(y2);
System.out.println(dim1);
System.out.println(flag);
System.out.println(lPoint);
mRec +=18;
}
}
length = x2-x1;
depth = y2-y1;
And here is the drawRect
g.drawRect(map.x1, map.y1, map.length, map.depth);
How do I get drawRect to draw all 4 rectangles?