charvax.swing
Class JTabbedPane

java.lang.Object
  extended bycharva.awt.Component
      extended bycharva.awt.Container
          extended bycharvax.swing.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
_alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
JTabbedPane()
          Construct a JTabbedPane.
 
Method Summary
 void add(Component component_, java.lang.Object constraints_)
          Add the specified component to the tabbed pane.
 void addTab(java.lang.String title_, java.lang.Object icon_, Component component_, java.lang.String keylabel_)
          Add a new tab with the specified component, title and function-key.
 void debug(int level_)
           
 void draw()
          Draw all the components in this container.
 int getSelectedIndex()
           
 Dimension getSize()
          Override the method in Container.
 int getTabCount()
          Returns the number of tabs in this tabbedpane.
 java.lang.String getTitleAt(int index)
          Returns the title of the tab with the specified index.
 int indexOfTab(java.lang.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, java.lang.String title)
          Sets the title of the tab with the specified index.
 
Methods inherited from class charva.awt.Container
add, doLayout, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getCurrentFocus, getHeight, getInsets, getWidth, invalidate, isFocusTraversable, isValid, 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, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getLocation, getLocationOnScreen, getName, getParent, hasFocus, hide, isDisplayed, isEnabled, isTotallyObscured, isVisible, processEvent, processFocusEvent, processMouseEvent, repaint, requestSync, setBounds, setBounds, setBounds, setEnabled, setLocation, setLocation, setName, setParent, setVisible, show, validateCursesColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTabbedPane

public JTabbedPane()
Construct a JTabbedPane.

Method Detail

add

public void add(Component component_,
                java.lang.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 class Container

addTab

public void addTab(java.lang.String title_,
                   java.lang.Object icon_,
                   Component component_,
                   java.lang.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.

setSelectedIndex

public void setSelectedIndex(int index_)

getSelectedIndex

public int getSelectedIndex()

setSelectedComponent

public void setSelectedComponent(Component component_)

getSize

public Dimension getSize()
Override the method in Container.

Overrides:
getSize in class Container

minimumSize

public Dimension minimumSize()
Override the method in Container.

Overrides:
minimumSize in class Container

draw

public void draw()
Description copied from class: Container
Draw all the components in this container.

Overrides:
draw in class Container

remove

public void remove(int index)
Removes the tab and component which corresponds to the specified index.


indexOfTab

public int indexOfTab(java.lang.String title)
Returns the first tab index with the specified title, or -1 if no tab has the title.


getTitleAt

public java.lang.String getTitleAt(int index)
Returns the title of the tab with the specified index.


setTitleAt

public void setTitleAt(int index,
                       java.lang.String title)
Sets the title of the tab with the specified index.


setEnabledAt

public void setEnabledAt(int index,
                         boolean enabled)
Make the tab at the specified index enabled.


isEnabledAt

public boolean isEnabledAt(int index)
Returns true if the tab the index is enabled.


getTabCount

public int getTabCount()
Returns the number of tabs in this tabbedpane.


debug

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