简体   繁体   English

JTabbedPane选项卡

[英]JTabbedPane tabs

Alright, so I have a JTabbedPane in an application and it has several panels. 好吧,所以我在一个应用程序中有一个JTabbedPane,它有几个面板。 Is it possible to assign a JPopupMenu to the actual tabs themselves instead of the JPanel? 是否可以将JPopupMenu分配给实际的标签本身而不是JPanel? If it is possible, how would I do this? 如果有可能,我该怎么做?

See http://www.java-forums.org/awt-swing/20810-how-can-i-add-popup-menu-tab-tabbedpane.html for an example. 有关示例,请参阅http://www.java-forums.org/awt-swing/20810-how-can-i-add-popup-menu-tab-tabbedpane.html

I think you would first call setTabComponentAt([each index], [a label with a popup attached]) then you would need to add a method in to change each of the tabs when they are clicked. 我想你首先会调用setTabComponentAt([each index], [a label with a popup attached])然后你需要添加一个方法来更改每个标签点击它们。

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

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