int toyNo=table.getRowCount ();
for(int k=0;k<toyNo;k++)
{
String s = table.getValueAt(k, 4).toString();
if(s != "取消")
{
to=new ToyOrdered();
to.name = new String(table.getValueAt(k, 0).toString());
to.num =Integer.parseInt (table.getValueAt(k, 2).toString());
to.cost= Float.parseFloat (table.getValueAt(k, 1).toString())*to.num;
al.add(to);
}
}
to 是一个保曾数据的类。