Reputation: 9512
I'm using a JTable with AbstractTableModel:
_model = new AbstractTableModel() {
@Override
public int getColumnCount() {
return _columns.size();
}
@Override
public int getRowCount() {
return _data.size();
}
@Override
public Object getValueAt(int row, int col) {
return _data.get(row)[col];
}
@Override
public String getColumnName(int i) {
return _columns.get(i);
}
};
When rows and columns change, calling table.revalidate() only shows changes to rows. Columns are exactly the same as before. Is there a way to force update for the whole table?
Upvotes: 0
Views: 554
Reputation: 9317
If you change columns you should call fireTableStructureChanged
on the model.
Upvotes: 2
Reputation: 1899
shouldn't it be
@Override
public Object getValueAt(int row, int col) {
return _data.get[row][col];
}
Upvotes: 0