This content has been marked as final. Show 1 reply
I found setting the values of the ScrollPane only work after the ScrollPane has been shown on a scene. Don't know why though.
If you place the scroll.setVvalue/setHvalue methods above the stage.show, they don't work, the layout remains positioned in the top left corner - guess the values get overwritten sometime during showing the ScrollPane on the scene. But placing the set calls after the show, the layout is center of the layout is displayed in the scroll pane. I think it could be a bug (OSX/JDK8b65).
ScrollPane scroll = new ScrollPane(); scroll.setContent(layout); stage.setScene(new Scene(scroll)); stage.show(); scroll.setVvalue(0.5); scroll.setHvalue(0.5);