I\'m subclassing JTable and using a DefaultTableModel to model my table data. The following class sets up the JTable, and adds one row to the model.
import
Dmitry is right, but you simply have to update your model. To do this, add the following to your code:
DefaultTableModel dtm = (DefaultTableModel) table.getModel(); for (int c = 0; c < table.getColumnCount(); c++) { dtm.addColumn(table.getColumnName(c)); }