Studiosus
Studiosus

Reputation: 143

Javafx Node position in Scrollpane

I want to know, if a node is visible at the current view position of a scrollpane and also how much.

Does anyone know how to read the position values of a node according to this issue? I tried it already with getBoundsInParent.getMaxX(), but this seems not to be the right way, because the parent of the node is not directly the scrollpane.

Upvotes: 2

Views: 641

Answers (1)

ItachiUchiha
ItachiUchiha

Reputation: 36792

To get the visible height of the scrollpane use

scrollPane.getViewportBounds().getHeight();

Upvotes: 1

Related Questions