How do I speed up the scroll speed in a JScrollPan

2019-01-21 09:59发布

I see the method JScrollPane.setWheelScrollingEnabled(boolean) to enable or disable the mouse wheel scrolling. Is there any way to adjust the speed of the scrolling, though? It is, in my opinion, ludicrously slow. No matter what size I make the window, the scrolling is about three pixels per click. I'd like it to be much more than that.

Any ideas?

8条回答
看我几分像从前
2楼-- · 2019-01-21 10:47

If you want to set the mouse wheel scroll amount indepedent of the scrollbar unit amout you can use the Mouse Wheel Controller.

查看更多
我命由我不由天
3楼-- · 2019-01-21 10:47

You can also use this.

SwingUtil.setScrollUnitIncrement(yourScrollPane);

查看更多
登录 后发表回答