我有一个JTable
并且我想添加列值。我正在尝试这段代码:
try{
double t = 0.00;
DecimalFormat df = new DecimalFormat("0.00");
int rows = empTbl.getRowCount();
for(int row =0; row<=rows; row++)
{
String am = (String) empTbl.getValueAt(row, 7);
double d = (double) df.parse(am);
double ans = d+t;
jLabel7.setText("Total Sale : "+ans);
}
}
catch(ParseException ex){ }
为什么这段代码不起作用?