Hi There, I have a JScrollPane scrollpane1, I've added a JSplitPane. On each side of the split pane are a JTable. The JTables are in sync with eachother. row 1 of table on left, correspond to row1 data of table on right of splitpane. However, I have a scrolling problem. When I need to scroll one table, i need to scroll the other by the same amount. Do i really need to put each of the table on a JScrollPane?? Or can I somehow manipulate the scrollpane1? please could i get some help. Thanks, Sarone
Ok I have decided to put the JTable on a JScrollPane each. I have used Gregg's code, and added a vertical adjustment listener. if I can just set the vertical position of scrollbar1 to be the same as the vertical position of scrollbar2, the one we moved, it would work. I'm searching in the api to see if I can do this.But can't find it. If anyone can find it please let me know. Thanks.
Joined: Jun 25, 2003
Problem solved: Do not need an adjustment listener simply do this:
and another cool thing i tripped upon is this:
subject: How to scroll tables on both sides of splitpane in sync?