Scrool bar size

Is there a way to change the size of the scroll bar to make it more touch friendly?

Call this script on the component to set its scrollbars. You may want to call the script in the window’s [tt]visionWindowOpened[/tt] event or something similar.

component = event.source #Make this the component you need to change the scrollbars for
scrollbarThickness = 20 #Change this to be the size you want

from java.awt import Dimension
jScrollPane = component.getViewport().getParent()
jScrollPane.getVerticalScrollBar().setPreferredSize(Dimension(scrollbarThickness, 0));
jScrollPane.getHorizontalScrollBar().setPreferredSize(Dimension(0, scrollbarThickness));

Below is what I have in the script for ‘visionWindowOpened’

component = event.source(‘schedDataTable’)
scrollbarThickness = 100
from java.awt import Dimension
jScrollPane = component.getViewport().getParent()
jScrollPane.getVerticleScrollBar().setPreferedSize(Dimension(scrollbarThickness, 0));
jScrollPane.getHorizontalScrollBar().setPreferredSize(Dimension(0, scrollbarThickness));

And I am getting the below error.

[color=#BF0000]Traceback (most recent call last):
File “event:visionWindowOpened”, line 1, in
TypeError: ‘com.inductiveautomation.factorypmi.application.FPMIWindow’ object is not callable[/color]

you want [tt]event.source.getRootContainer().getComponent(‘schedDataTable’)[/tt] on your first line. If the schedDataTable component is inside other containers, you’ll want to add the proper .getComponent() calls in the middle to navigate to it.

It looks like if you change the scroll bar width in the Project Properties, it will change the scroll bar width for all components. FYI I am using 7.9