How to get ScrollPane max vvalue

与世无争的帅哥 提交于 2019-12-25 04:11:40

问题


I can get current vvalue with following code:

    s1.vvalueProperty().addListener(new ChangeListener<Number>() {
        public void changed(ObservableValue<? extends Number> ov,
                            Number old_val, Number new_val) {
            println("s1.vvalue:${s1.vvalue.inspect()}")
            System.out.println(new_val.intValue());
        }
    });

How to listen ScrollPane is scrolled to the end?(how to get max vvalue?)


回答1:


Much better than hard-coding 1.0, call ScrollPane.getVMax(). If the value changes in the future, your application might not break!

https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/ScrollPane.html#getVmax--




回答2:


I find the solution:

when scroll to the end, the vvalue is 1.0



来源:https://stackoverflow.com/questions/40456468/how-to-get-scrollpane-max-vvalue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!