borland Packages  Class Hierarchy  jbcl.control Package  Index 

TabsetPanel component

java.lang.Object
   +----java.awt.Component
           +----java.awt.Container
                   +----com.sun.java.swing.JComponent
                           +----borland.jbcl.view.BeanPanel
                                   +----borland.jbcl.view.TabsetView
                                           +----borland.jbcl.control.TabsetPanel

About the TabsetPanel component

Variables  Constructors  Properties  Methods  Event Listeners

Implements ItemPaintSite, VectorModelListener, VectorSelectionListener, VectorView, ImageObserver, MenuContainer, Serializable, EventListener

The TabsetPanel component is a panel controlled by a set of mutually exclusive tabs, such as those commonly used in tabbed dialog boxes, also known as multi-page dialogs. The TabsetPanel component acts as a container for tabbed pages; the TabsetControl component represents a set of tabs only.

TabsetPanel extends TabsetView, so many of the properties and methods you need for working with a tabset panel are found in TabsetView. For example, the tabsOnTop property determines whether the tabs appear on the top or bottom of the panel; if there is not enough space to display all the tabs, a scrollbar appears next to the tabs. The selectedTab property identifies the currently selected tab by the label of the tab, and the selectedIndex property identifes the tab by the position of the tab in the row of tabs with 0 being the first one.

For an example of working with the most common properties of the TabsetPanel, see Working with Advanced Components in the Building Applications with JBuilder.

Usually you will want to place a panel on each "page" of the TabsetPanel. On the panel, you can put the controls you want displayed when the associated tab is selected. Think of a page as the tab, an associated component, usually a panel, and everything on that panel.

By using the add(String, Component) method, you can specify the label on the tab and add a panel to the associated page. For example, add("Snazzy options", bevelPanel2) adds the bevel panel to a new page and the tab label is "Snazzy options".

Or you can simply call add(Component) to add the panel and have the name of the panel appear as the text on the tab. For example, if you call add(Display), where Display is the name of a bevel panel, a new tab and page appears with the bevel panel on the page and the tab label set to "Display".

You can also use addTab() to add a tab to TabsetPanel without adding a panel. removeTab() removes a tab but the associated panel is still available for use. removePage() deletes both the tab and the panel. removeAll() removes all tabs and pages.

To see a sample TabsetPanel application, examine the JBuilder\samples\borland\samples\jbcl\tabsetpanel project.


TabsetPanel variables

Variables implemented in borland.jbcl.view.BeanPanel

Variables implemented in borland.jbcl.view.TabsetView

Variables implemented in com.sun.java.swing.JComponent

Variables implemented in java.awt.Component

TabsetPanel constructors

TabsetPanel properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in borland.jbcl.view.BeanPanel

Properties implemented in borland.jbcl.view.TabsetView

Properties implemented in com.sun.java.swing.JComponent

Properties implemented in java.awt.Component

Properties implemented in java.awt.Container

Properties implemented in java.lang.Object

TabsetPanel methods

Methods implemented in this class

Methods implemented in borland.jbcl.view.BeanPanel

Methods implemented in borland.jbcl.view.TabsetView

Methods implemented in com.sun.java.swing.JComponent

Methods implemented in java.awt.Component

Methods implemented in java.awt.Container

Methods implemented in java.lang.Object

TabsetPanel event listeners


TabsetPanel constructors

TabsetPanel()

  public TabsetPanel()
Constructs a default TabsetPanel with no tabs. The layout manager is a CardLayout. A blank panel that displays when no tab is selected is added.

TabsetPanel properties

insets

 public Insets getInsets()
Returns the position of the component on a page. The getInsets() method of the TabsetView is called first, then margins are added to the returned Insets.

labels

 public void setLabels(java.lang.String[] labels)
Creates a page and a tab for each string specified in the labels array. Using the labels property, you can set all the labels of a TabsetPanel at once. If labels specifies a tab that already exists in the TabsetPanel, that tab is not replaced.

layout

 public final void setLayout(java.awt.LayoutManager mgr)
This method does nothing.

margins

 public Insets getMargins()
 public void setMargins(java.awt.Insets margins)
Determines the margins around a component on to a page.

preferredSize

 public Dimension getPreferredSize()
Returns the preferred size of the TabsetPanel.

selectedPage

 public Component getSelectedPage()
 public void setSelectedPage(java.awt.Component page)
Specifies the selected page.

textureName

 public String getTextureName()
 public void setTextureName(java.lang.String path)
Determines the name of the Image file that is tiled on the background of the control to give the appearance of texture. Specify the file name and directory using the path parameter.

TabsetPanel methods

addImpl(java.awt.Component, java.lang.Object, int)

  public void addImpl(java.awt.Component page, java.lang.Object label, int index)
Used when add(Component page, Object label) is called.

Overrides: java.awt.Container.addImpl(Component, Object, int)

addTab(int, java.lang.String)

  public void addTab(int aheadOf, java.lang.String item)
Adds a tab to the TabsetPanel.

Parameters:

aheadOf
Indicates the position of the tab the new tab is inserted ahead of. The first tab in the tab row has a position of 0, the second has a position of 1, and so on.
item
The string that becomes the label for the new tab.

addTab(java.lang.Object)

  public void addTab(java.lang.Object item)
Adds a tab item to the TabsetPanel. The item is an Object instead of a string. For example, this method could add a graphic in place of a string label.

Parameters:

item
The object added as a new tab.

Overrides: borland.jbcl.view.TabsetView.addTab(Object)

remove(java.awt.Component)

  public void remove(java.awt.Component page)
Removes the tab and associated component (a page) on the TabsetPanel.

Parameters:

page
The page removed from the tabset panel.

Overrides: java.awt.Container.remove(Component)

removeAll()

  public void removeAll()
Removes all pages (all tabs and their associated components).

Overrides: java.awt.Container.removeAll()

removePage(java.awt.Component)

  public void removePage(java.awt.Component page)
Removes the specified component and the tab associated with it.

Parameters:

page
The component and its associated tab (the page).

removeTab(java.lang.String)

  public void removeTab(java.lang.String item)
Removes the specified tab and its associated component (a page).

Parameters:

item
The string that identifies the tab of the page to remove.

Overrides: borland.jbcl.view.TabsetView.removeTab(java.lang.Object)

updateTabInfo()

  protected void updateTabInfo()
Synchronizes the TabInfo array of TabsetViewPanel with the PageInfo array of TabsetPanel. This method is called whenever a tab is added or removed or the value of the labels property changes.

Overrides: borland.jbcl.view.TabsetView.updateTabInfo()

updateUI()

  public void updateUI()

Overrides: com.sun.java.swing.JComponent.updateUI() Updates the user interface of the panel in preparation for painting.


TabsetPanel event listeners

This component is a source for the following event sets. For information on the standard AWT event sets, see Standard Java events. For information on the JBCL event sets, see Events in JBCL.

action

 public synchronized void addActionListener(java.awt.event.ActionListener l)
 public synchronized void removeActionListener(java.awt.event.ActionListener l)

ancestor

 public void addAncestorListener(com.sun.java.swing.event.AncestorListener )
 public void removeAncestorListener(com.sun.java.swing.event.AncestorListener )

component

 public synchronized void addComponentListener(java.awt.event.ComponentListener )
 public synchronized void removeComponentListener(java.awt.event.ComponentListener )

container

 public synchronized void addContainerListener(java.awt.event.ContainerListener )
 public void removeContainerListener(java.awt.event.ContainerListener )

focus

 public synchronized void addFocusListener(java.awt.event.FocusListener )
 public synchronized void removeFocusListener(java.awt.event.FocusListener )

key

 public synchronized void addKeyListener(java.awt.event.KeyListener )
 public synchronized void removeKeyListener(java.awt.event.KeyListener )

model

 public void addModelListener(borland.jbcl.model.VectorModelListener l)
 public void removeModelListener(borland.jbcl.model.VectorModelListener l)

mouse

 public synchronized void addMouseListener(java.awt.event.MouseListener )
 public synchronized void removeMouseListener(java.awt.event.MouseListener )

mouseMotion

 public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener )
 public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )

propertyChange

 public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener )
 public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )

selection

 public void addSelectionListener(borland.jbcl.model.VectorSelectionListener l)
 public void removeSelectionListener(borland.jbcl.model.VectorSelectionListener l)

subfocus

 public void addSubfocusListener(borland.jbcl.model.VectorSubfocusListener l)
 public void removeSubfocusListener(borland.jbcl.model.VectorSubfocusListener l)

vetoableChange

 public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener )
 public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )