Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

enter image description here

like image 859
Christian Moen Avatar asked Oct 30 '16 11:10

Christian Moen


People also ask

What is scrollpane in JavaFX?

The JavaFX package is available in javafx.scene.control.ScrollPane package. Scroll pane is allowed to view complete elements by vertical and horizontal scroll. ScrollPane (): It is a default constructor, used to create a scroll pane instance.

How do you scroll a node in JavaFX?

Whatever the reason, JavaFX makes it easy to provide scrolling capabilities to any node in a scene graph. This is accomplished by wrapping the node in a ScrollPane. When a ScrollPane is used, scrollbars are automatically implemented that scroll the contents of the wrapped node. No further action is required on your part.

What is a scrollpane?

A Control that provides a scrolled, clipped viewport of its contents. It allows the user to scroll the content around either directly (panning) or by using scroll bars. The ScrollPane allows specification of the scroll bar policy, which determines when scroll bars are displayed: always, never, or only when they are needed.

What is the viewport in a JavaFX scrollpane?

The visible part of a JavaFX ScrollPane is called the ScrollPane viewport . As you scroll around the content displayed inside the ScrollPane using the scrollbars, the viewport is moved around the content too, making different parts of the content visible.


1 Answers

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.

like image 55
Dustin R Avatar answered Oct 24 '22 07:10

Dustin R