| |
e828. Creating a JTabbedPane Container
A tabbed pane is a container that displays only one child
component at a time. Typically, the children are themselves
containers of other components. Each child is associated with a
visible tab on the tabbed pane. The user can choose a child to
display by selecting the tab associated with that child.
// Create a child container which is to be associated with a tab
JPanel panel = new JPanel();
// Add components to the panel...
// Specify on which edge the tabs should appear
int location = JTabbedPane.TOP; // or BOTTOM, LEFT, RIGHT
// Create the tabbed pane
JTabbedPane pane = new JTabbedPane();
// Add a tab
String label = "Tab Label";
pane.addTab(label, panel);
e829.
Getting and Setting the Selected Tab in a JTabbedPane Container
e830.
Adding a Tab to a JTabbedPane Container
e831.
Removing a Tab in a JTabbedPane Container
e832.
Moving a Tab in a JTabbedPane Container
e833.
Getting the Tabs in a JTabbedPane Container
e834.
Setting the Location of the Tabs in a JTabbedPane Container
e835.
Enabling and Disabling a Tab in a JTabbedPane Container
e836.
Setting the Tool Tip for a Tab in a JTabbedPane Container
e837.
Setting the Color of a Tab in a JTabbedPane Container
e838.
Enabling the Selection of a Tab in a JTabbedPane Container Using a Keystroke
e839.
Enable Scrolling Tabs in a JTabbedPane Container
e840.
Determining When the Selected Tab Changes in a JTabbedPane Container
© 2002 Addison-Wesley.
|