设置滚动条粗细 [英] Set scrollbar thickness
本文介绍了设置滚动条粗细的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在 JScrollPane
中调整滚动条的粗细?默认是一种笨重。
Is there a way to adjust the thickness of the scrollbar within a JScrollPane
? the default is kind of clunky.
推荐答案
一个快速但又脏的解决方案是将宽度/高度明确地设置为例如10像素通过
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));
其他方式是提供正确的 ScrollBarUI
。
Other way would be to provide a proper ScrollBarUI
.
这篇关于设置滚动条粗细的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文