Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set scrollbar thickness

Is there a way to adjust the thickness of the scrollbar within a JScrollPane? the default is kind of clunky.

like image 459
Sinaesthetic Avatar asked Mar 20 '11 21:03

Sinaesthetic


1 Answers

A quick but also dirty solution is to set the width/height explicitely to e.g. 10 pixels via

jScrollPane.getVerticalScrollBar().setPreferredSize(new Dimension(10, 0));
jScrollPane.getHorizontalScrollBar().setPreferredSize(new Dimension(0, 10));

Other way would be to provide a proper ScrollBarUI.

like image 176
Howard Avatar answered Sep 22 '22 09:09

Howard