Java: Possible to replace TableModel in an existing JTable?

opike picture opike · May 30, 2011 · Viewed 9.8k times · Source

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

Answer

a_horse_with_no_name picture a_horse_with_no_name · May 30, 2011

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

Check the Javadocs for details