JTabbedPane 滚动按钮位置
一直在使用 JTabbedPane
并尝试在使用 SCROLL_TAB_LAYOUT
特别是滚动方向按钮时对其进行自定义。
我正在扩展 BasicTabbedPaneUI
,但我没有看到更改滚动按钮位置的方法或能力。环顾四周,除了使用不同的外观和感觉之外,没有看到任何人这样做。我认为控制滚动方向按钮的位置通常非常有用。
有谁知道如何在扩展 BasicTabbedPaneUI
或任何其他方法时执行此操作?
Been working with JTabbedPane
and trying to customize it when using SCROLL_TAB_LAYOUT
specifically with the scroll direction buttons.
I'm extending BasicTabbedPaneUI
, but I don't see a method or ability to change the location of the scroll buttons. Searched around and don't see any one doing this other than just using different look and feels. Control over the location of scroll direction buttons would be very useful in general I feel.
Does anyone have any ideas how to do this while extending BasicTabbedPaneUI
or any other method?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您想将向后滚动按钮移动到选项卡的另一侧。
在 BasicTabbedPaneUI 类中,有一个
createDecreaseButton
方法仅属于包(无访问修饰符)。看来您必须使用您自己的
createDecreaseButton
版本创建自己的BasicTabbedPaneUI
类。I'm assuming you want to move the scroll backwards button to the other side of the tabs.
In the BasicTabbedPaneUI class, there's a
createDecreaseButton
method that's package only (no access modifier).It appears you're going to have to create your own
BasicTabbedPaneUI
class, with your own version ofcreateDecreaseButton
.我在没有使用许多其他组件的情况下更改了滚动按钮位置,而只是扩展了 BasicTabbedPaneUI 并修改了其 Paint() 方法来调整按钮位置。
这是代码:
I changed the scroll button position without using many other components but simply extends the BasicTabbedPaneUI and hacking its paint() method to adjust the button position.
Here is the code: