我在程序中写了一段代码:System.out.println("Browcount="+tableModel.getRowCount());System.out.println("BtableValue="+tableModel.getDataVector());//初始化输出表格for(inti=0...
我在程序中写了一段代码:
System.out.println("B row count="+tableModel.getRowCount());
System.out.println("B table Value="+tableModel.getDataVector());
//初始化输出表格
for(int i=0;i
tableModel.removeRow(i);
System.out.println("RemoveRow index="+i);
}
System.out.println("A row count="+tableModel.getRowCount());
System.out.println("A table Value="+tableModel.getDataVector());
目的就是清空tableModel中所有的数据,下面是执行完成后输出的数据:
B row count=5
B table Value=[[0, 检测结果, InspectResult, 整型], [1, 斑点分析, ResultDoc.Err:7, 字符串], [2, 斑点分析, Reserve:7, 整型], [1, 斑点分析, ResultDoc.Err:7, 字符串], [0, 检测结果, InspectResult, 整型]]
RemoveRow index=0
RemoveRow index=1
RemoveRow index=2
A row count=2
A table Value=[[1, 斑点分析, ResultDoc.Err:7, 字符串], [1, 斑点分析, ResultDoc.Err:7, 字符串]]
object=2 斑点分析 Reserve:7
请教高手,为什么执行removeRow()方法后tableModel中还有数据存在?
展开