有什么方法可以同步 JavaFX 1.2 ListView 中的滚动条吗?
我并排有多个列表视图。我有办法确保“selectedIndex”在所有这些上都相同,但是有没有办法使滚动条始终同步?
似乎只要用户在向下导航列表视图时使用箭头键,滚动条就会同步,但是,如果用户按住该键或使用鼠标滚轮,则它们根本不会同步。
I have multiple listviews sidebyside. I have a way to make sure the "selectedIndex" is the same on all of them, but is there a way to make it so the scrollbar's are ALWAYS synchronized?
It seems that the scrollbars WILL be synced as long as the user uses the ARROW KEYS when navigating down the listview, however, if the user HOLDS DOWN the key, OR USES THE MOUSE WHEEL, they will not be synchronized at all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,这是不可能的,即使在 1.3 中也无法访问内部滚动条,并且也有任何方法可以设置自定义滚动条。如果可以的话,请针对 JavaFX 运行时提出问题,描述您的用例。 http://javafx-jira.kenai.com
Unfortunately this is not possible, even in 1.3 there is no access to internal scrollbar and also there is any way how to set up custom scrollbar. If you can please file an issue against JavaFX Runtime describing your use-case. http://javafx-jira.kenai.com
老问题,但万一有人感兴趣:我现在使用下面的类(在 FX2.2 中测试)来同步 2 个 ListView 的滚动:
然后我只需调用以下代码:
Old question but in case somebody is interested : I now use the class below (Tested in FX2.2) to synchronize the scrolling of 2 ListViews :
Then I just have to call this code :