java loops
Collapse
X
-
ok ..i posted print statements to see what was going on. i did a print statement afterCode:sum += Integer.parseInt((String)dataTable.getValueAt(i, 4)); System.out.println(sum);
so is the sum+= not working right??Comment
-
actually i just figured it out..i fixed it with the following:
Code:for(int i=0; i < dataTable.getRowCount(); i++) { int entry = Integer.parseInt( (String) dataTable.getValueAt(i,4)); sum += entry; String total = Integer.toString(sum); total1.setText(total);
Thanks for your help!Comment
-
actually i just figured it out..i fixed it with the following:
Code:for(int i=0; i < dataTable.getRowCount(); i++) { int entry = Integer.parseInt( (String) dataTable.getValueAt(i,4)); sum += entry; String total = Integer.toString(sum); total1.setText(total);
Thanks for your help!
kind regards,
JosComment
Comment