public class BTabbedPane extends WidgetContainer
In addition to the event types generated by all Widgets, BTabbedPanes generate the following event types:
Modifier and Type | Class and Description |
---|---|
static class |
BTabbedPane.TabPosition
This inner class represents a position for the tabs.
|
Modifier and Type | Field and Description |
---|---|
static BTabbedPane.TabPosition |
BOTTOM |
static BTabbedPane.TabPosition |
LEFT |
static BTabbedPane.TabPosition |
RIGHT |
static BTabbedPane.TabPosition |
TOP |
Constructor and Description |
---|
BTabbedPane()
Create a new BTabbedPane with the tabs along the top.
|
BTabbedPane(BTabbedPane.TabPosition pos)
Create a new TabbedContainer.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Widget widget,
java.lang.String tabName)
Add a Widget to this container.
|
void |
add(Widget widget,
java.lang.String tabName,
javax.swing.Icon image)
Add a Widget to this container.
|
void |
add(Widget widget,
java.lang.String tabName,
javax.swing.Icon image,
int index)
Add a Widget to this container.
|
Widget |
getChild(int i)
Get the i'th child of this container.
|
int |
getChildCount()
Get the number of children in this container.
|
int |
getChildIndex(Widget widget)
Get the index of a particular Widget.
|
java.util.Collection<Widget> |
getChildren()
Get a Collection containing all child Widgets of this container.
|
javax.swing.JTabbedPane |
getComponent()
Get the java.awt.Component corresponding to this Widget.
|
int |
getSelectedTab()
Get the index of the tab which is currently selected.
|
javax.swing.Icon |
getTabImage(int index)
Get the image displayed on a particular tab.
|
java.lang.String |
getTabName(int index)
Get the name displayed on a particular tab.
|
BTabbedPane.TabPosition |
getTabPosition()
Get the position of the tabs (TOP, LEFT, BOTTOM, or RIGHT).
|
void |
layoutChildren()
Layout the child Widgets.
|
void |
remove(int index)
Remove a child Widget from this container.
|
void |
remove(Widget widget)
Remove a child Widget from this container.
|
void |
removeAll()
Remove all child Widgets from this container.
|
void |
setSelectedTab(int index)
Set which tab is selected.
|
void |
setTabImage(int index,
javax.swing.Icon image)
Set the image displayed on a particular tab.
|
void |
setTabName(int index,
java.lang.String name)
Set the name displayed on a particular tab.
|
void |
setTabPosition(BTabbedPane.TabPosition pos)
Set the position of the tabs (TOP, LEFT, BOTTOM, or RIGHT).
|
isOpaque, setOpaque
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible
addEventLink, addEventLink, removeEventLink
public static final BTabbedPane.TabPosition TOP
public static final BTabbedPane.TabPosition LEFT
public static final BTabbedPane.TabPosition BOTTOM
public static final BTabbedPane.TabPosition RIGHT
public BTabbedPane()
public BTabbedPane(BTabbedPane.TabPosition pos)
pos
- the position for the tabs (TOP, LEFT, BOTTOM, or RIGHT)public javax.swing.JTabbedPane getComponent()
Widget
getComponent
in class Widget
public int getChildCount()
getChildCount
in class WidgetContainer
public Widget getChild(int i)
public java.util.Collection<Widget> getChildren()
getChildren
in class WidgetContainer
public void layoutChildren()
layoutChildren
in class WidgetContainer
public void add(Widget widget, java.lang.String tabName)
widget
- the Widget to addtabName
- the name to display on the tabpublic void add(Widget widget, java.lang.String tabName, javax.swing.Icon image)
widget
- the Widget to addtabName
- the name to display on the tabimage
- the image to display on the tabpublic void add(Widget widget, java.lang.String tabName, javax.swing.Icon image, int index)
widget
- the Widget to addtabName
- the name to display on the tabimage
- the image to display on the tabindex
- the position at which to add this tabpublic void remove(Widget widget)
remove
in class WidgetContainer
widget
- the Widget to removepublic void remove(int index)
index
- the index of the Widget to removepublic void removeAll()
removeAll
in class WidgetContainer
public int getChildIndex(Widget widget)
widget
- the Widget to locatepublic BTabbedPane.TabPosition getTabPosition()
public void setTabPosition(BTabbedPane.TabPosition pos)
public java.lang.String getTabName(int index)
index
- the index of the tabpublic void setTabName(int index, java.lang.String name)
index
- the index of the tabname
- the name to displaypublic javax.swing.Icon getTabImage(int index)
index
- the index of the tabpublic void setTabImage(int index, javax.swing.Icon image)
index
- the index of the tabimage
- the image to displaypublic int getSelectedTab()
public void setSelectedTab(int index)
index
- the index of the tabWritten by Peter Eastman.