borland Packages Class Hierarchy jbcl.control Package Index
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
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.
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.
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.
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.
public final void setLayout(java.awt.LayoutManager mgr)This method does nothing.
public Insets getMargins() public void setMargins(java.awt.Insets margins)Determines the margins around a component on to a page.
public Dimension getPreferredSize()Returns the preferred size of the TabsetPanel.
public Component getSelectedPage() public void setSelectedPage(java.awt.Component page)Specifies the selected page.
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.
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)
public void addTab(int aheadOf, java.lang.String item)Adds a tab to the TabsetPanel.
Parameters:
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:
Overrides: borland.jbcl.view.TabsetView.addTab(Object)
public void remove(java.awt.Component page)Removes the tab and associated component (a page) on the TabsetPanel.
Parameters:
Overrides: java.awt.Container.remove(Component)
public void removeAll()Removes all pages (all tabs and their associated components).
Overrides: java.awt.Container.removeAll()
public void removePage(java.awt.Component page)Removes the specified component and the tab associated with it.
Parameters:
public void removeTab(java.lang.String item)Removes the specified tab and its associated component (a page).
Parameters:
Overrides: borland.jbcl.view.TabsetView.removeTab(java.lang.Object)
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()
public void updateUI()
Overrides: com.sun.java.swing.JComponent.updateUI() Updates the user interface of the panel in preparation for painting.
public synchronized void addActionListener(java.awt.event.ActionListener l) public synchronized void removeActionListener(java.awt.event.ActionListener l)
public void addAncestorListener(com.sun.java.swing.event.AncestorListener ) public void removeAncestorListener(com.sun.java.swing.event.AncestorListener )
public synchronized void addComponentListener(java.awt.event.ComponentListener ) public synchronized void removeComponentListener(java.awt.event.ComponentListener )
public synchronized void addContainerListener(java.awt.event.ContainerListener ) public void removeContainerListener(java.awt.event.ContainerListener )
public synchronized void addFocusListener(java.awt.event.FocusListener ) public synchronized void removeFocusListener(java.awt.event.FocusListener )
public synchronized void addKeyListener(java.awt.event.KeyListener ) public synchronized void removeKeyListener(java.awt.event.KeyListener )
public void addModelListener(borland.jbcl.model.VectorModelListener l) public void removeModelListener(borland.jbcl.model.VectorModelListener l)
public synchronized void addMouseListener(java.awt.event.MouseListener ) public synchronized void removeMouseListener(java.awt.event.MouseListener )
public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener ) public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener ) public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )
public void addSelectionListener(borland.jbcl.model.VectorSelectionListener l) public void removeSelectionListener(borland.jbcl.model.VectorSelectionListener l)
public void addSubfocusListener(borland.jbcl.model.VectorSubfocusListener l) public void removeSubfocusListener(borland.jbcl.model.VectorSubfocusListener l)
public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener ) public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )