I can get minX
of viewport bounds by scrollView.getViewportBounds().getMinX()
, but how can I set it?
I think a solution that can help me with this problem is: JavaFX How to scroll ScrollPane to have node in the middle of view port?
I can get minX
of viewport bounds by scrollView.getViewportBounds().getMinX()
, but how can I set it?
I think a solution that can help me with this problem is: JavaFX How to scroll ScrollPane to have node in the middle of view port?
You can't. getViewportBounds()
returns a Bounds
object which is immutable.
I'm guessing you want to restrict where the scrollpane can scroll to? Then you need to use the hmax
, hmin
, hvalue
and vmax
, vmin
, vvalue
properties of the ScrollPane.