Click to See Complete Forum and Search --> : Update column names in JTable (Urgent!)


klavergne
February 28th, 2000, 11:08 AM
I need to be able to update column names in a JTable dynamically. I have tried to use a TableModel to control the column names and I can change a column name in the model, but the JTable doesn't update on the screen. How can I force it to get the new column name and repaint? Thanx in advance.

Kevin

Proverbs9_10
February 28th, 2000, 08:09 PM
I just know how to do it in DefaultTableModel

In DefaultTableModel,
you find the method setColumnIdentifiers(Object[] newIdentifiers)
or setColumnIdentifiers(Vector newIdentifiers)

If you are using AbstractTableModel,
you have to call fireTableStructureChanged()

Hope that can help u.

poochi
February 28th, 2000, 11:46 PM
did you try ,

tableHeader.resizeAndRepaint() ?