如何在JavaFX中设置滚动窗格的单位增量? [英] How can I set the unit increment for a scroll pane in JavaFX?
问题描述
JavaFX中的 ScrollBar 类包含用于设置单位增量,这就是我所追求的 - 但我无法找到如何获得此ScrollBar,或者从ScrollPane 课程!我认为我必须遗漏一些明显的东西 - 我如何实现这一目标?
The ScrollBar class in JavaFX contains a property for setting the unit increment, which is what I'm after - however I can't find how to get at this ScrollBar, or set the unit increment some other way from the ScrollPane class! I presume I must be missing something obvious - how do I achieve this?
推荐答案
从技术上讲,你应该能够实现这一目标初始化外观后使用 .lookup(scrollbar)
方法(如果滚动条可见)。我不喜欢那个答案。
Technically, you should be able to get to it using the .lookup("scrollbar")
method after the skin is initialized (if the scrollbar is visible). I don't like that answer though.
根据这个错误罚单,我认为你没有遗漏任何东西:
I don't think you're missing anything according to this bug ticket:
- 如何访问ScrollPane控件中的ScrollBar组件?
https://bugs.openjdk.java.net/browse/JDK-8091864
- How to access to ScrollBar component in ScrollPane control ?
https://bugs.openjdk.java.net/browse/JDK-8091864
我鼓励你跳过它,展示你的用例,投票,看看你是否可以在将来得到某种回应。
I'd encourage you to jump on that, present your use case, vote, and see if you can get some sort of response in the future.
这篇关于如何在JavaFX中设置滚动窗格的单位增量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!