Java examples for Swing:JTable Model
Remove all the rows from a DefaultTableModel
//package com.java2s; import javax.swing.table.DefaultTableModel; public class Main { /**// w w w . j ava2s.c o m * Remove all the rows from a DefaultTableModel * * @param modelo * @return */ public static void removeAllRows(DefaultTableModel modelo) { int a = modelo.getRowCount(); for (int i = 0; i < a; i++) { modelo.removeRow(0); } } }