charvax.swing

Class JTabbedPane


public class JTabbedPane
extends Container

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.

Field Summary

Fields inherited from class charva.awt.Container

_components, _currentFocus, _insets, _isValid, _layoutMgr, _minimumSize, _size

Fields inherited from class charva.awt.Component

BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT, _alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible

Constructor Summary

JTabbedPane()
Construct a JTabbedPane.

Method Summary

void
add(Component component_, Object constraints_)
Add the specified component to the tabbed pane.
void
addTab(String title_, Object icon_, Component component_, String keylabel_)
Add a new tab with the specified component, title and function-key.
void
debug(int level_)
void
draw()
int
getSelectedIndex()
Dimension
getSize()
Override the method in Container.
int
getTabCount()
Returns the number of tabs in this tabbedpane.
String
getTitleAt(int index)
Returns the title of the tab with the specified index.
int
indexOfTab(String title)
Returns the first tab index with the specified title, or -1 if no tab has the title.
boolean
isEnabledAt(int index)
Returns true if the tab the index is enabled.
Dimension
minimumSize()
Override the method in Container.
void
remove(int index)
Removes the tab and component which corresponds to the specified index.
void
setEnabledAt(int index, boolean enabled)
Make the tab at the specified index enabled.
void
setSelectedComponent(Component component_)
void
setSelectedIndex(int index_)
void
setTitleAt(int index, String title)
Sets the title of the tab with the specified index.

Methods inherited from class charva.awt.Container

add, add, debug, doLayout, draw, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getCurrentFocus, getHeight, getInsets, getSize, getWidth, invalidate, isFocusTraversable, isValid, minimumSize, nextFocus, previousFocus, processKeyEvent, remove, requestFocus, setBackground, setFocus, setForeground, setHeight, setLayout, setSize, setSize, setWidth, validate

Methods inherited from class charva.awt.Component

addFocusListener, addKeyListener, contains, contains, debug, draw, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getHeight, getLocation, getLocationOnScreen, getName, getParent, getSize, getWidth, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isTotallyObscured, isValid, isVisible, minimumSize, processEvent, processFocusEvent, processKeyEvent, processMouseEvent, repaint, requestFocus, requestSync, setBackground, setBounds, setBounds, setBounds, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColor

Constructor Details

JTabbedPane

public JTabbedPane()
Construct a JTabbedPane.

Method Details

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.
Overrides:
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.
Parameters:
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.

debug

public void debug(int level_)
Overrides:
debug in interface Container

draw

public void draw()
Overrides:
draw in interface Container

getSelectedIndex

public int getSelectedIndex()

getSize

public Dimension getSize()
Override the method in Container.
Overrides:
getSize in interface Container

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.

minimumSize

public Dimension minimumSize()
Override the method in Container.
Overrides:
minimumSize in interface Container

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.