This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes about JTabbed Pane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "about JTabbed Pane" Watch "about JTabbed Pane" New topic
Author

about JTabbed Pane

sachin dabhade
Ranch Hand

Joined: Mar 10, 2001
Posts: 73
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
keerthi matta
Greenhorn

Joined: May 31, 2002
Posts: 27
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
Chris Shepherd
Ranch Hand

Joined: Jun 27, 2000
Posts: 286
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: about JTabbed Pane
 
Similar Threads
Problem with tabbed panes
HELP NEEDED~~
How to add new tabs from JMenu
regarding repaint() in JTabbedPane
h:commandButton