• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

about JTabbed Pane

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

sachin
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic