问题描述
奇怪的是 JScrollPane 没有方法 addAdjustmentListener().然而,adjustmentListener 据说是与滚动条一起使用的.每当 JScrollPane 以任何一种方式滚动时,我都希望发生一些事情.如何实现这样的事情?
It's strange that JScrollPane doesn't have a method addAdjustmentListener(). Yet adjustmentListener is said to be used with scrollbars. I want something to happen whenever the JScrollPane is scrolled in either way. How to achieve such a thing?
推荐答案
为什么不获取实际的滚动条,然后向它们添加调整侦听器?JScrollBar 有一个名为 addAdjustmentListener() 的方法.
Why don't you get the actual scrollbars, and then add adjustment listeners to them? JScrollBar has a method called addAdjustmentListener().
您可以使用 getVerticalScrollBar() 和 getHorizontalScrollBar() 从 JScrollPane 中获取 JScrollBar
And you can use getVerticalScrollBar() and getHorizontalScrollBar() to get a JScrollBar from a JScrollPane
这篇关于JScrollPane 的滚动事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)