Java:“添加标签按钮”对于JTabbedPane [英] Java: "Add Tab Button" for a JTabbedPane
本文介绍了Java:“添加标签按钮”对于JTabbedPane的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以像在Firefox中一样向选项卡式窗格添加按钮。
Is it possible to add a button to a tabbed pane like in firefox.
加号按钮就是我想要的。
The plus-button is what I want.
谢谢
推荐答案
我认为您应该能够通过构建自己的 JTabbedPaneUI来管理它code>并使用
setUI
在 JTabbedPane
上设置它。
I think you should be able to manage it by building your own JTabbedPaneUI
and setting it on the JTabbedPane
using setUI
.
您的 ComponentUI
具有获取可访问孩子的方法。如果您指定 JButton
和 JLabel
,那么您可能正在营业。
Your ComponentUI
has methods to get a hold of the accessible children. If you specify a JButton
and a JLabel
then you may be in business.
我自己并没有尝试过。这风险自负:)
I haven't attempted this myself though. This is "at your own risk" :)
这篇关于Java:“添加标签按钮”对于JTabbedPane的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文