Scroll bar is slow for repeaters

So there’s a post from 2012 regarding this exact issue.
But here I am in 2015 with the same issue but for the scrollbar on my template repeater.

The final suggestion was:

[code]
#increases scroll bar speed
from javax.swing import SwingUtilities
from javax.swing import JScrollPane

scrollPane = SwingUtilities.getAncestorOfClass(JScrollPane, event.source)

scrollPane.getVerticalScrollBar().setUnitIncrement(10)[/code]

and my implementation:

[code]#increases scroll bar speed
from javax.swing import SwingUtilities
from javax.swing import JScrollPane

scrollPane = SwingUtilities.getAncestorOfClass(JScrollPane, system.gui.getParentWindow(event).getComponentForPath(‘Root Container.action_blocks’))

scrollPane.getVerticalScrollBar().setUnitIncrement(10000)[/code]

Obviously I’m missing something here.

Try this:

[code]from javax.swing import SwingUtilities
from javax.swing import JScrollPane

scrollPane = SwingUtilities.getAncestorOfClass(JScrollPane, event.source.parent.getComponent(‘Template Repeater’).getComponents()[1].getComponents()[2])

scrollPane.getVerticalScrollBar().setUnitIncrement(30) #scroll amount for wheel and arrows
scrollPane.getVerticalScrollBar().setBlockIncrement(30) #scroll amount clicking on scrollbar itself

[/code]

Hi Matt,

This code works:

repeater = event.source.parent.getComponent('Template Repeater')
jscrollPane = repeater.getComponents()[1]
jscrollPane.getVerticalScrollBar().setUnitIncrement(50)

It is just a matter of getting the right JScrollPane.
Best,

2 Likes

Perfecto! Thank you so much for this