This will get you started. You should add a ChangeListener
to sync the scrollbar positions.
In the initialize
extension function on the first table add this script
from javax.swing.event import ChangeListener
tableMain = self.parent.getComponent('Power Table')
table2 = self.parent.getComponent('Power Table 1')
class myListener(ChangeListener):
def stateChanged(self, e):
scrollBarMain = tableMain.getVerticalScrollBar()
scrollBar2 = table2.getVerticalScrollBar()
scrollBar2.setValue(scrollBarMain.getValue())
#to remove ChangeListener
listeners = tableMain.viewport.getChangeListeners()
for listener in listeners:
tableMain.viewport.removeChangeListener(listener)
#to add ChangeListener
tableMain.viewport.addChangeListener(myListener())
You may want to consider this comment from a similar thread.