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

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?


Solution 1:

You can try this :

myJScrollPane.getVerticalScrollBar().setUnitIncrement(16);

Solution 2:

One way would be to set the unit increment of the scrollbar to a larger number:

scrollPane.getVerticalScrollBar().setUnitIncrement(20);