自定义 JScrollBar 箭头
我想创建 JScrollBar,其底部带有增加和减少按钮,以防垂直滚动条,如所附图像所示。 (Mac OS 风格)
我需要类似
------------O-----------<>
的东西而不是
<----------O-------------->
你能帮我解决这个问题吗?
I would like to create JScrollBar with increase and decrease buttons at the bottom in case of vertical scrollbar as shown in the image attached. (Mac OS Style)
I need something like
------------O-----------<>
instead of
<----------O-------------->
Could you please help me with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 ScrollBarUI 或 L&F 实现之一的源代码,了解各个 Look And Feel 类如何实现它们所实现的目标。然后,您需要重新编写 Paint 方法来绘制您的版本。
这里是BasicL&F的源代码。
不过,我还建议寻找已经做到这一点的 L&F,因为我确信有人已经在 L&F 平台之一中做到了这一点。
Take a look at the source code for the ScrollBarUI or one of the L&F implementations, to see how the individual Look And Feel classes achieve what they achieve. You will then need to re-write the paint method to draw your version.
here is the source code for the BasicL&F.
However, I would also suggest searching for a L&F that already does this, as I am sure someone has already done this in one of the L&F platforms.