如何获取ScrollPane最大vvalue [英] How to get ScrollPane max vvalue

查看:70
本文介绍了如何获取ScrollPane最大vvalue的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用以下代码获取当前vvalue:

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());
        }
    });

如何收听ScrollPane滚动到末尾?(如何获取最大vvalue?)

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

推荐答案

比硬编码1.0好得多,请调用ScrollPane.getVMax().如果该值将来会更改,则您的应用程序可能不会损坏!

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

这篇关于如何获取ScrollPane最大vvalue的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆