I try to design swing gui in Netbeans. I want to hide some of tabs according to role of user, for example role 1 see tab1,and tab2; role 2 see tab2 and tab3. I try to this with editing initComponents but it is not possible. What is the solution for this situation? any advice?
You need to have a jTabbedPane that will contain all the tabs that you want.
In order to remove a tab:
jTabbedPane1.remove(jPanel1);
In order to add a new tab:
jTabbedPane1.add(jPanel1);
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.