Reputation: 7585
Is it possible to replace the entire TableModel in an existing JTable or do I have to recreate the JTable?
Upvotes: 7
Views: 10965
Reputation:
You can set a new model using the JTable.setModel()
method
Check the Javadocs for details
Upvotes: 15
Reputation: 51
When you change the model you are stuck with old column titles. getColumnName()
only gets called on initialization.
Upvotes: 5