A component that lets the user display one of a set of components
(usually Panels) at a time.
The management of the tab-selection has to be performed outside of this
component because it is possible that the currently selected tab does
not contain any focusTraversable components. In this case, this JTabbedPane
will never get the keyboard focus.
add
public void add(Component component_,
Object constraints_)
Add the specified component to the tabbed pane. If
constraints
is a String, it will be used as the tab's
title; otherwise the component's name will be used as the title.
- add in interface Container
addTab
public void addTab(String title_,
Object icon_,
Component component_,
String keylabel_)
Add a new tab with the specified component, title and function-key.
title_
- The title of this tab.icon_
- An icon representing the component being added. This is
not used and is just for compatibility with Swing. Pass null for this
parameter.component_
- The component to be added in this tab.keylabel_
- A String representing the key that must be pressed to
select this tab.
draw
public void draw()
Draw all the components in this container.
- draw in interface Container
getSelectedIndex
public int getSelectedIndex()
getTabCount
public int getTabCount()
Returns the number of tabs in this tabbedpane.
getTitleAt
public String getTitleAt(int index)
Returns the title of the tab with the specified index.
indexOfTab
public int indexOfTab(String title)
Returns the first tab index with the specified title, or
-1 if no tab has the title.
isEnabledAt
public boolean isEnabledAt(int index)
Returns true if the tab the index is enabled.
remove
public void remove(int index)
Removes the tab and component which corresponds to the specified
index.
setEnabledAt
public void setEnabledAt(int index,
boolean enabled)
Make the tab at the specified index enabled.
setSelectedComponent
public void setSelectedComponent(Component component_)
setSelectedIndex
public void setSelectedIndex(int index_)
setTitleAt
public void setTitleAt(int index,
String title)
Sets the title of the tab with the specified index.