Java: Possible to replace TableModel in an existing JTable?
Is it possible to replace the entire TableModel in an existing JTable or do I have to r开发者_JAVA技巧ecreate the JTable?
You can set a new model using the JTable.setModel()
method
Check the Javadocs for details
When you change the model you are stuck with old column titles. getColumnName()
only gets called on initialization.
精彩评论