Is there a way to change the column headings for a JTable that has already been instantiated? I have spent hours going over the API's for TableModel, TableColumnModel, etc., and just can't find a Class or method that will let me do it! Any ideas? Thanks
The table model hast a method getColumnName() which returns the names of the columns whenever the JTable questions them. It will call this method especially after a TableStructureChanges event occured, which would be fired by the TableModel. Thus, to change the column names (headers): 1. change the columns in the implementation of the table model (you're free on that) 2. fireTableStructureChanged (that might not be the exact name, but it's something like that) in the table model. 3. the rest should happen automatically! Chantal
Post by:autobot
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
a bit of art, as a gift, that will fit in a stocking