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

前端 未结 9 746
庸人自扰
庸人自扰 2020-12-12 23:03

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 scro

相关标签:
9条回答
  • 2020-12-13 00:04

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

    scrollPane.getVerticalScrollBar().setUnitIncrement(20);
    
    0 讨论(0)
  • 2020-12-13 00:06

    You can do this by setting the unit increment for a ScrollBar. See the example.

    yourScrollPane.getVerticalScrollBar().setUnitIncrement(16);
    
    0 讨论(0)
  • 2020-12-13 00:07

    I was trying to find a better method to read through 32000 lines in my ScrollPane

    try this

    scrollPane.getVerticalScrollBar().setUnitIncrement(100); scrollPane.getViewport().putClientProperty("EnableWindowBlit", Boolean.TRUE); scrollPane.getViewport().setScrollMode(JViewport.BACKINGSTORE_SCROLL_MODE);

    0 讨论(0)
提交回复
热议问题