How do I speed up the scroll speed in a JScrollPane when using the mouse wheel?

Erick Robertson picture Erick Robertson · Apr 7, 2011 · Viewed 53.7k times · Source

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?

Answer

StKiller picture StKiller · Apr 7, 2011

You can try this :

myJScrollPane.getVerticalScrollBar().setUnitIncrement(16);