I use following code to change column name:
It actually works but in GUI it updates only when I click on column header.Code Java:
where could be the problem?
Printable View
I use following code to change column name:
It actually works but in GUI it updates only when I click on column header.Code Java:
where could be the problem?
Likely it's because you're not explicitly forcing a repaint.
You need to notify the model the the table structure has changed. Presuming the TableModel of your JTable extends AbstractTableModel, call fireTableStructureChanged() on the model
thanks, copeg! your solution worked but it recreated all table from model which contained old data so I had to change approach. now I use model.setColumnIdentifiers(columnNames) each time I need to change columnNames and it works. thanks again. :)