使用鼠标滚轮时,如何加快JScrollPane中的滚动速度? [英] How do I speed up the scroll speed in a JScrollPane when using the mouse wheel?

查看:1156
本文介绍了使用鼠标滚轮时,如何加快JScrollPane中的滚动速度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到方法 JScrollPane.setWheelScrollingEnabled(boolean)启用或禁用鼠标滚轮滚动。有没有办法调整滚动的速度?在我看来,这是非常缓慢的。无论我制作什么尺寸的窗口,滚动每次点击大约三个像素。我希望它远不止于此。

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.

任何想法?

推荐答案

你可以试试这个:

myJScrollPane.getVerticalScrollBar().setUnitIncrement(16);

这篇关于使用鼠标滚轮时,如何加快JScrollPane中的滚动速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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