Hi all,
I wanted to be able to scroll ( vertically ) more tables based on just one scrollbar. I searched inside the forum but found nothing. Just some related posts. I took code from various posts and combined them together ( with no logic ) and I came up with the perfect result I wanted. Now, I am not a Java Expert ( I’m a Pythonian ), I was wondering if someone could help me figure out how this bunch of code is working.
Here it is:
I have 3 power tables called “Power Table”, “Power Table 1”, “Power Table 2”.
Inside the Mouse Clicked event of the Power Table I have the following code:
foo = event.source.getVerticalScrollBar()
table_2 = event.source.parent.getComponent('Power Table 1')
table_2.setVerticalScrollBar(foo)
table_3 = event.source.parent.getComponent('Power Table 2')
table_3.setVerticalScrollBar(foo)
Inside the Initialize event of the Power Table I have the following code:
from java.awt.event import MouseWheelEvent
from java.awt.event import MouseWheelListener
class DebugMouseWheelListener(MouseWheelListener):
def mouseWheelMoved(self, event):
print "Scroll wheel notches moved:", event.getWheelRotation()
print "Units to scroll:", event.getUnitsToScroll()
self.addMouseWheelListener(DebugMouseWheelListener())
No code inside the others table.
Here there’s a video showing the result https:/uploads/iatesting/original/2X/a/a8545339f7e56263e556aafd258b1d205f4b40fb.mp4