tags:

views:

8

answers:

0

I have two JTables sharing the same Model object and the first JTable returns the first two columns and the next JTable returns rest of columns.I have a common scroll bar and moving the scroll bar moves both at the same time.Initially I have 10 rows in the table and I try to add 22 rows on click of a button.When I add the rows I delete the previous rows by

for(int i=0;i<tableModel,getRowCount();i++)
{
table1Model.removeRow(0);
}

and then add the new rows as Vector

 tableModel.addRow(vector);

Now after doing this when I scroll the table1 becomes unreadable when I scroll down.

I used this example to build two tables with same scroll bar .FixedColumn

I am using DefaultTableModel instead of AbstractTableModel

I don't know why this problem occurs.Can anyone help me in solving this problem.?

I can give more info if needed.