1 Reply Latest reply on Dec 6, 2012 11:42 AM by jsmith

    How to set scrollpane position

      I have a ScrollPane and VBox inside of it. VBox control is bigger and scroll is shown.
      I tried to set position of scroll, but nothing worked.

      I used scrollPane.setVvalue(position), where position is value from 0 to 1, but it does not work at all.
      May be I missed something?
        • 1. Re: How to set scrollpane position
          I found setting the values of the ScrollPane only work after the ScrollPane has been shown on a scene. Don't know why though.
          ScrollPane scroll = new ScrollPane();
          stage.setScene(new Scene(scroll));
          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).