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

查看:46
本文介绍了使用鼠标滚轮时如何加快 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天全站免登陆