Andrew Cubides

Greenhorn
+ Follow
since May 09, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andrew Cubides

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
22 years ago