All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JTabbedPane

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JTabbedPane

public class JTabbedPane
extends JComponent
implements Accessible, Serializable
A control that lets the user switch between a group of components by clicking on a title.


Variable Index

 o changeEvent
Only one ChangeEvent is needed per TabPane instance since the event's only (read-only) state is the source property.
 o changeListener
The changeListener is the listener we add to the model.
 o model

Constructor Index

 o JTabbedPane()
Creates an empty TabbedPane.

Method Index

 o addAccessibleSelection(int)
Selects the given tab.
 o addChangeListener(ChangeListener)
Adds a ChangeListener to the button.
 o addTab(String, Component)
Adds a component represented by a title and no icon.
 o addTab(String, Icon, Component)
Adds a component represented by a title and/or icon, either of which can be null.
 o addTab(String, Icon, Component, String)
Adds a component and tip represented by a title and/or icon, either of which can be null.
 o createChangeListener()
Subclasses that want to handle ChangeEvents differently can override this to return a subclass of ModelListener or another ChangeListener implementation.
 o fireStateChanged()
 o getAccessibleAt(Point)
Returns the Accessible child contained at the local coordinate Point, if one exists.
 o getAccessibleChild(int)
Return the nth Accessible child of the object.
 o getAccessibleChildrenCount()
Returns the number of accessible children in the object.
 o getAccessibleRole()
Get the role of this object.
 o getAccessibleSelection(int)
Returns an Accessible representing the nth selected item in the object.
 o getAccessibleSelectionCount()
Returns the number of items currently selected.
 o getComponentAt(int)
Returns the component at index.
 o getIconAt(int)
Returns the icon at index.
 o getModel()
Returns the model associated with the TabbedPane.
 o getSelectedIndex()
All of the Model methods are implemented by delegation.
 o getTabCount()
Returns the number of tabs.
 o getTitleAt(int)
Returns the title at index.
 o getToolTipText(MouseEvent)
Returns the string to be used as the tooltip for event.
 o getUI()
Returns the TabbedPane's UI controller.
 o getUIClassID()
 o indexOfTab(String)
Convenience method for locating the first tab with a given title, testing for equality with String.equals.
 o insertTab(String, Icon, Component, String, int)
Inserts a component, at index, represented by a title and/or icon, either of which may be null.
 o removeChangeListener(ChangeListener)
Removes a ChangeListener from the button.
 o removeTabAt(int)
Removes the tab at index.
 o setComponentAt(int, Component)
Sets the component at index to component.
 o setIconAt(int, Icon)
Sets the icon at index to icon which can be null.
 o setModel(SingleSelectionModel)
Sets the model to be used with the TabbedPane.
 o setSelectedIndex(int)
 o setTitleAt(int, String)
Sets the title at index to title which can be null.
 o setUI(TabbedPaneUI)
Sets the TabbedPane's UI controller.
 o updateUI()
Notification from the UIFactory that the L&F has changed.

Variables

 o model
 protected SingleSelectionModel model
 o changeListener
 protected ChangeListener changeListener
The changeListener is the listener we add to the model.

 o changeEvent
 protected transient ChangeEvent changeEvent
Only one ChangeEvent is needed per TabPane instance since the event's only (read-only) state is the source property. The source of events generated here is always "this".

Constructors

 o JTabbedPane
 public JTabbedPane()
Creates an empty TabbedPane.

See Also:
addTab

Methods

 o getUI
 public TabbedPaneUI getUI()
Returns the TabbedPane's UI controller.

See Also:
setUI
 o setUI
 public void setUI(TabbedPaneUI ui)
Sets the TabbedPane's UI controller.

Parameters:
ui - the new UI object
See Also:
getUI
 o updateUI
 public void updateUI()
Notification from the UIFactory that the L&F has changed.

Overrides:
updateUI in class JComponent
 o getUIClassID
 public String getUIClassID()
Returns:
"TabbedPaneUI"
Overrides:
getUIClassID in class JComponent
See Also:
getUIClassID, getUI
 o createChangeListener
 protected ChangeListener createChangeListener()
Subclasses that want to handle ChangeEvents differently can override this to return a subclass of ModelListener or another ChangeListener implementation.

 o addChangeListener
 public void addChangeListener(ChangeListener l)
Adds a ChangeListener to the button.

 o removeChangeListener
 public void removeChangeListener(ChangeListener l)
Removes a ChangeListener from the button.

 o fireStateChanged
 protected void fireStateChanged()
 o getModel
 public SingleSelectionModel getModel()
Returns the model associated with the TabbedPane.

See Also:
setModel
 o setModel
 public void setModel(SingleSelectionModel model)
Sets the model to be used with the TabbedPane.

Parameters:
model - the model to be used
See Also:
getModel
 o getSelectedIndex
 public int getSelectedIndex()
All of the Model methods are implemented by delegation.

 o setSelectedIndex
 public void setSelectedIndex(int index)
 o insertTab
 public void insertTab(String title,
                       Icon icon,
                       Component component,
                       String tip,
                       int index)
Inserts a component, at index, represented by a title and/or icon, either of which may be null. Uses java.util.Vector internally, see insertElementAt() for details of insertion conventions.

Parameters:
component - The component to be displayed when this tab is clicked.
 o addTab
 public void addTab(String title,
                    Icon icon,
                    Component component,
                    String tip)
Adds a component and tip represented by a title and/or icon, either of which can be null. Cover method for insertTab().

See Also:
insertTab
 o addTab
 public void addTab(String title,
                    Icon icon,
                    Component component)
Adds a component represented by a title and/or icon, either of which can be null. Cover method for insertTab().

See Also:
insertTab
 o addTab
 public void addTab(String title,
                    Component component)
Adds a component represented by a title and no icon. Cover method for insertTab().

See Also:
insertTab
 o removeTabAt
 public void removeTabAt(int index)
Removes the tab at index.

 o getTabCount
 public int getTabCount()
Returns the number of tabs.

 o getTitleAt
 public String getTitleAt(int index)
Returns the title at index.

 o getIconAt
 public Icon getIconAt(int index)
Returns the icon at index.

 o getComponentAt
 public Component getComponentAt(int index)
Returns the component at index.

 o setTitleAt
 public void setTitleAt(int index,
                        String title)
Sets the title at index to title which can be null. An internal exception is raised if there is no tab at that index.

 o setIconAt
 public void setIconAt(int index,
                       Icon icon)
Sets the icon at index to icon which can be null. An internal exception is raised if there is no tab at that index.

 o setComponentAt
 public void setComponentAt(int index,
                            Component component)
Sets the component at index to component. An internal exception is raised if there is no tab at that index.

 o indexOfTab
 public int indexOfTab(String title)
Convenience method for locating the first tab with a given title, testing for equality with String.equals. Returns -1 if no tab has this title.

 o getToolTipText
 public String getToolTipText(MouseEvent event)
Returns the string to be used as the tooltip for event.

Overrides:
getToolTipText in class JComponent
 o getAccessibleRole
 public AccessibleRole getAccessibleRole()
Get the role of this object.

Returns:
an instance of AccessibleRole describing the role of the object
Overrides:
getAccessibleRole in class JComponent
See Also:
AccessibleRole
 o getAccessibleChildrenCount
 public int getAccessibleChildrenCount()
Returns the number of accessible children in the object.

Returns:
the number of accessible children in the object.
Overrides:
getAccessibleChildrenCount in class JComponent
 o getAccessibleChild
 public Accessible getAccessibleChild(int i)
Return the nth Accessible child of the object.

Parameters:
i - zero-based index of child
Returns:
the nth Accessible child of the object
Overrides:
getAccessibleChild in class JComponent
 o getAccessibleSelectionCount
 public int getAccessibleSelectionCount()
Returns the number of items currently selected. This will always be 1.

Returns:
the number of items currently selected.
Overrides:
getAccessibleSelectionCount in class JComponent
 o getAccessibleSelection
 public Accessible getAccessibleSelection(int i)
Returns an Accessible representing the nth selected item in the object. This will always be the current Page that is selected.

Parameters:
i - the zero-based index of selected items
Returns:
an Accessible containing the selected item
Overrides:
getAccessibleSelection in class JComponent
 o addAccessibleSelection
 public void addAccessibleSelection(int i)
Selects the given tab.

Parameters:
i - the zero-based index of selectable items
Overrides:
addAccessibleSelection in class JComponent
 o getAccessibleAt
 public Accessible getAccessibleAt(Point p)
Returns the Accessible child contained at the local coordinate Point, if one exists.

Returns:
the Accessible at the specified location, if it exists
Overrides:
getAccessibleAt in class JComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index