I have a JScrollPane containing a JTable.... I have an "Add New Row" button that creates a new blank row in the JTable... my problem is that the scrollpane doesn't seem to update when the table keeps growing due to added rows. I can keep adding rows but then they disappear below the scrollpane and I can't scroll down to see them.
Here is the code from the action listener of the "Add New Row" button:
-------------------------
Vector v = new Vector();
DefaultTableModel dfm = (DefaultTableModel)table.getModel();
dfm.addRow(v);
int rowCount = table.getRowCount();
dfm.fireTableStructureChanged();
table.setModel(dfm);
table.revalidate();
pane.doLayout();
-------------
As you can see I tried every method I could think of to try and get the ScrollPane to update.
Any insight would be great, thank you...
Andrew