Ok, I have read up on this, but I'm still very confused. I have a JTable with a custom Table Model that stores data in an ArrayList. It displays just fine. However, when I want to add a row, I add an object to the ArrayList, then call fireTableRowsInserted(...). However, the table does not refresh.
public Main() {
initComponents();
current_map = new Map();
current_map.authors.add(new Author("New Author"));
author_model = new AuthorModel(current_map.authors);
jTable1.setModel(new AuthorModel(current_map.authors)); <---This is the mistake
}
...
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
author_model.authors.add(new Author("New Author"));
author_model.fireTableRowsInserted(author_model.authors.size(), author_model.authors.size());
}
The above code is from my main JFrame. Not sure where to go from here.
I'm lost right now.