| |
e837. Setting the Color of a Tab in a JTabbedPane Container
// Create a tabbed pane
JTabbedPane pane = new JTabbedPane();
// Set the text color for all tabs
pane.setForeground(Color.YELLOW);
// Set the background color for all tabs
pane.setBackground(Color.MAGENTA);
// Add a tab
String label = "Tab Label";
pane.addTab(label, component);
// Get index of the new tab
int index = pane.getTabCount()-1;
// Set text color for the new tab
pane.setForegroundAt(index, Color.ORANGE);
// Set background color for the new tab
pane.setBackgroundAt(index, Color.GREEN);
e828.
Creating a JTabbedPane Container
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
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.
|