I have an applicatin where i have used JTabbedPane. It contains a tab called " Inventory" and "Others" on clicking,inventory i want to open another TabbedPane on the same contentpane with following tabs. 1.Add Item 2.Remove Item 3.Check inventory. i tried adding another tabbedpane to the same contentpane but only the first tabbedpane is displayed. the sub tabbed pane is not displayed. can anybody help me to get a path out of it? thanks in advance.
hi, According to ur requirement when u click on the Inventory tab , the another TabbedPane is being added to the Container , but this Tabbed Pane is at the back of the first TabbedPane , so it is not being displayed , and i dont think u need one more TabbedPane to add , becoz when u can add these new Tabs to the previous Tabbed Pane itself , they will displayed after the "Others" Tab . Hope this will solve ur problem . keerthi
Hmm are you actually trying to replace the "inventory/other" tabbedPane with the other one or are you just trying to show the new one inside the inventorypane? Adding it inside the inventory pane should be fairly easy. You just have to put the tabbedPane with all the inventory options inside a JPanel and then include that when you make your call to add the Inventory pane.
If you are trying to replace the main tabbedPane when you select the "inventory" tab, you should consider using something besides a tabbedPane for this selection. TabbedPane is made to switch between displayed panels/viewable objects easily, not to be used like buttons.