问题
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