You can create a table model and add it to a table
TableModel tm = new TableModel();
JTable table = new JTable(tm);
however, if I init a Table
JTable table = new JTable();
and then create a table model later on…
TableModel tm = new TableModel();
tm.addValueAt(...);
...
Is there a way I can add this table model to the original table?
I’ve actually created my own classes to extend TableModel and JTable, and I thought that I could simply reconstruct the table given the new table model, but this doesn’t seem to work.
As stated here: JTable, You can use
setModel(TableModel)