看下API。0小于当前size的话,当前index及大于index的将被discardhttp://docs.oracle.com/javase/7/docs/api/javax/swing/table/DefaultTableModel.html#setRowCount(int)public void setRowCount(int rowCount) Sets the number of rows in the model. If the new size is greater than the current size, new rows are added to the end of the model If the new size is less than the current size, all rows at index rowCount and greater are discarded. Since: 1.3 See Also: setColumnCount(int)
Sets the number of rows in the model. If the new size is greater than the current size, new rows are added to the end of the model If the new size is less than the current size, all rows at index rowCount and greater are discarded.
Since:
1.3
See Also:
setColumnCount(int)