Java:Removing all the rows of DefaultTableModel
I want to delete all the rows of DefaultTable.I found two common ways to delete them on internet but none of them works in my case because those methods does not exist in my DefaultTableModel .I wonder why :S .My code for using DefaultTableModel is DefaultTableModel Table = (DefaultTableModel) Table.getModel(); One way to delete is Table.removeRow(Table.getRowCount() - 1); but this removerow method does not exist in my DefaultTableModel. Please help me out. mKorbel Why complicating simple things, but removes must be iterative, if (myTableModel.getRowCount() > 0) { for (int i = myTableModel