简体   繁体   中英

ScrollPane JavaFX make it scroll more?

In javaFX scrollpane. It scrolls so slowly.. Any method to boost it up? I've looked all over here, and no luck.. I've found some thread about listview..

Demonstration:

在此输入图像描述

You could do this in the FXML styling.

.scroll-pane .scroll-bar:vertical {
-fx-unit-increment: 5 ;
-fx-block-increment: 5 ;
}

.scroll-pane .scroll-bar:horizontal {
-fx-unit-increment: 5 ;
-fx-block-increment: 5 ;
}

Play around with the unit and block increment numbers until you get a desired effect.

Set cache to true.

In the pane inside the scrollpane not scrollPane.

yourPane.setCache(true);

Or in SceneBuilder Properties-Extras-select Cache CheckBox

The unit increment method may be what you are looking for:

scrollPane.getVerticalScrollBar().setUnitIncrement(20);

The larger the number the faster the scroll speed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM