Java: can I replace TableModel in an existing JTable?

Is it possible to replace the entire TableModel in an existing JTable or do I need to recreate a JTable?

+6
source share
2 answers

You can install a new model using the JTable.setModel() method

More About Javadocs

+12
source

When you change the model, you are stuck with old column headers. getColumnName() only called upon initialization.

+3
source

Source: https://habr.com/ru/post/889393/


All Articles