Link to home
Start Free TrialLog in
Avatar of bjg
bjg

asked on

Synchronizing vertical scrollbars

I have two JTables (each is contained in a JScrollPane).  The JTable on the left is fixed and I do not want to show the scrollbars, but the JTable on the right is not fixed and the scrollbars show if they are needed.  I want to be able to synch up the left JTable's vertical scrollbar with that of the right JTable's vertical scrollbar so that when the right table is scrolled vertically, the left table scrolls with it.  What is the best way to do this?  (Note:  keep in mind that the left table will never show a horizontal scrollbar but the right table may have a horizontal scrollbar if one is needed.)
ASKER CERTIFIED SOLUTION
Avatar of samnelson
samnelson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bjg
bjg

ASKER

This will not do what I am looking for because the problem does not lie within when the right scrollpane's horizontal scrollbar is being scrolled, but the vertical scrollbar.  

If the right horizontal scrollbar is visible while scrolling the right vertical scrollbar, the rows do not always line up between the left table and the right table because the visible viewports are different sizes (because the right table's viewport has a horizontal scrollbar showing, but the left table's viewport does not show a horizontal scrollbar).  Therefore, I have to somehow look for this situation and correct it.  How can I do this?
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  Or if you are an EE Pro user, click the link below to select open items for your Member ID using Power Search:
https://www.experts-exchange.com/jsp/qPowerSearch.jsp.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
https://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange