How to set the desired position scrollpane?


Question

Method sp.setVvalue(app.spvalue.intValue()); doesn't scroll vbox to desired position.

            mvPane = new VBox();
            mvPane.setStyle("-fx-background-color: #fff;");
            GetPlayList(app,root);

            sp = new ScrollPane();
            sp.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
            sp.setContent(mvPane);
            sp.setVvalue(40);
            setCenter(sp);
            sp.getVvalue();

Function GetPlayList adds many labels.

1
0
12/24/2012 8:48:07 AM

If you are talking about JavaFX 2.0, and its scrollPane, then Hvalue and Vvalue properties are working well, but the matter, look like, that their values are doubles from range [0.0 .. 1.0], so, when you set int value, it will not work fine.

3
1/5/2013 10:56:32 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon