开发者

JTabbedPane tabs

开发者 https://www.devze.com 2023-01-08 23:06 出处:网络
Alright, so I have a JTabbedPane in an application and it has several panels. Is it possible to assign a JPopupMenu to the actual tabs themselves instead of the JPanel? If it is 开发者_开发知识库possi

Alright, so I have a JTabbedPane in an application and it has several panels. Is it possible to assign a JPopupMenu to the actual tabs themselves instead of the 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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消