jbcl.control Package
java.lang.Object +----java.awt.Component +----java.awt.Container +----javax.swing.JComponent +----com.borland.jbcl.view.BeanPanel +----com.borland.jbcl.view.TabsetView +----com.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 Using a TabsetPanel in the JBCL Programmer's Guide.
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 tabsetpanel project in the samples directory of your JBuilder application.
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 void setEnabled(boolean enabled)Determines whether the panel is enabled. If the
enabled
parameter is true, the panel is enabled and users can use the panel and the controls on it. If enabled
is false, users won't be able to use the panel and its controls.
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(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(LayoutManager mgr)This method does nothing.
public Insets getMargins() public void setMargins(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(Component page)Specifies the selected page.
public String getTextureName() public void setTextureName(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(Component page, Object label, int index)Used when
add(Component page, Object label)
is called.
public void addTab(int aheadOf, String item)Adds a tab to the
TabsetPanel
.
Parameters:
aheadOf
item
public void addTab(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
Overrides: com.borland.jbcl.view.TabsetView.addTab(Object)
public void remove(Component page)Removes the tab and associated component (a page) on the
TabsetPanel
.
Parameters:
page
public void removeAll()Removes all pages (all tabs and their associated components).
Overrides: java.awt.Container.removeAll()
public void removePage(Component page)Removes the specified component and the tab associated with it.
Parameters:
page
public void removeTab(String item)Removes the specified tab and its associated component (a page).
Parameters:
item
Overrides: com.borland.jbcl.view.TabsetView.removeTab(java.lang.Object)
protected void updateTabInfo()Synchronizes the
TabInfo
array of TabsetViewPanel
with the P
ageInfo array of TabsetPanel
. This method is called whenever a tab is added or removed or the value of the labels
property changes.
Overrides: com.borland.jbcl.view.TabsetView.updateTabInfo()
public void updateUI()
Overrides: javax.swing.JComponent.updateUI() Updates the user interface of the panel in preparation for painting.
public synchronized void addActionListener(ActionListener l) public synchronized void removeActionListener(ActionListener l)
public void addAncestorListener(javax.swing.event.AncestorListener ) public void removeAncestorListener(javax.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 synchronized 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 addInputMethodListener(java.awt.event.InputMethodListener ) public synchronized void removeInputMethodListener(java.awt.event.InputMethodListener )
public synchronized void addKeyListener(java.awt.event.KeyListener ) public synchronized void removeKeyListener(java.awt.event.KeyListener )
public void addModelListener(VectorModelListener l) public void removeModelListener(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(VectorSelectionListener l) public void removeSelectionListener(VectorSelectionListener l)
public void addSubfocusListener(VectorSubfocusListener l) public void removeSubfocusListener(VectorSubfocusListener l)
public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener ) public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )