Creating a Tabbed Pane
A tabbed pane is a UI container that groups components
such as buttons, checkboxes, and text fields on multiple panels. Each
panel has a title and a tab that the end user clicks to view the panel
contents.
To create a tabbed pane:
-
Create a frame or other container
.
-
In the Swing Containers page of the
Component Palette, click the JTabbedPane
component.
-
Click inside the container in the Java Visual Editor to drop the
tabbed pane with its default size.
-
Resize the tabbed pane as desired.
-
To add the first tab to the tabbed pane, click the
JPanel component in the Swing Containers
page of the Component Palette, then click on the JTabbedPane inside
the Java Visual Editor.
-
To add additional tabs to the tabbed pane, after you click the
JPanel component in the Component Palette, you must click specifically
on the tab itself of a previously added tab panel.
-
To add a layout panel (one that has no tabs) to any of the tabbed pane
tabs, click the JPanel component in the
Swing Containers page of the Component Palette, then click the content
area of the JTabbedPane inside the Java Visual Editor (in this case,
do not click the tab itself).
To work with a panel that is not currently the top most tab in the
Java Visual Editor, click directly on the tab. When you select tab,
you also raise the panel to the top of the stacking order.
Alternatively, you can select tab panels by choosing the desired
panel in the Structure Window. To view the panels you have added to
the tabbed pane, expand the UI folder,
expand the dataPanel node, and finally
expand the JTabbedPane node to see the
list of JPanels.
Related topics
About Containers
Copyright © 1997, 2004, Oracle. All rights reserved.