简体   繁体   English

向JTabbedPane选项卡栏添加“最小化”按钮

[英]Adding a 'Minimize' button to JTabbedPane Tab Bar

I've searched extensively to solutions for this but haven't found anything that really achieves what I'm trying to do, the closest thing I could find was the solution posted at the bottom of this thread: http://www.java-forums.org/awt-swing/12267-how-add-jbutton-tabbed-pane-headder.html . 我已经对此进行了广泛的搜索,但是还没有找到任何能够真正实现我想要的功能的东西,我能找到的最接近的东西是该线程底部发布的解决方案: http : //www.java -forums.org/awt-swing/12267-how-add-jbutton-tabbed-pane-headder.html

However because the JTabbedPane I'm using is inside a JSplitPane, it's size can increase/decrease, so using that solution doesn't work as the button stays static. 但是,由于我正在使用的JTabbedPane位于JSplitPane内部,因此它的大小可以增加/减小,因此,由于按钮保持静态,因此无法使用该解决方案。

Below is an image of where I would like the place the component, similar to how eclipse has a minimize button on it's pop out views. 下面是我想要放置组件的位置的图像,类似于eclipse在弹出视图上如何具有最小化按钮的方式。

在此处输入图片说明

Is this possible without creating a custom JTabbedPane component? 是否可以在不创建自定义JTabbedPane组件的情况下实现?

Do you really need this button to hide? 您是否真的需要隐藏此按钮?

Why don't you set splitpane.setOneTouchExpandable(true); 为什么不设置splitpane.setOneTouchExpandable(true); ?

With this line you can hide the bottom with an arrow of the splitpane. 使用此行,您可以使用拆分窗格的箭头隐藏底部。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM