简体   繁体   中英

JTabbedPane tabs

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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