Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

about JTabbed Pane

Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Doody calls. I would really rather that it didn't. Comfort me wise and sterile tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic