|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
com.sshtools.ui.awt.TabbedPanel
public class TabbedPanel
AWT component to provide a tabbed pane similar to Swings JTabbedPane (albeit somewhat simpler!).
Each component added except the first will be invisible until the user clicks on the tab heading either above, below. to the left, or to the right of the visible component. Clicking on the heading will hide the current tab and make the new selection visible.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
BOTTOM
Tabs are placed below the components |
static int |
LEFT
Tabs are placed to the left of the components |
static int |
RIGHT
Tabs are placed to the right of the components |
static int |
TOP
Tabs are placed above the components |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
TabbedPanel(int position)
Create a tabbed panel with the tabs at the specified position. |
|
| Method Summary | |
|---|---|
void |
add(java.awt.Component comp,
java.lang.Object constraints,
java.awt.Image image)
|
void |
add(java.awt.Component comp,
java.lang.Object constraints,
int index,
java.awt.Image image)
Add a tab. |
void |
addActionListener(java.awt.event.ActionListener l)
Add an ActionListener to be informed when the user selects
a tab. |
protected void |
addImpl(java.awt.Component comp,
java.lang.Object constraints,
int index)
|
void |
addNotify()
|
java.awt.Insets |
getInsets()
|
int |
getPosition()
|
int |
getSelectedTab()
Get the index of the currently selected tab |
int |
getSelectedTabIndex()
|
static void |
main(java.lang.String[] args)
|
void |
paint(java.awt.Graphics g)
|
void |
remove(int idx)
|
void |
removeActionListener(java.awt.event.ActionListener l)
Remove an ActionListener so as to no longer be informed when
the user selects a tab. |
void |
removeNotify()
|
void |
setPosition(int position)
Create a tabbed panel with the tabs at the specified position. |
void |
setSelectedTab(int idx)
Set the selected tab given its index. |
void |
setTitleAt(int i,
java.lang.String title)
Set the title of a tab at the given index |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int TOP
public static final int LEFT
public static final int BOTTOM
public static final int RIGHT
| Constructor Detail |
|---|
public TabbedPanel(int position)
Create a tabbed panel with the tabs at the specified position. Can be one of :-
Note, only TOP is currently supported
position - position| Method Detail |
|---|
public void addActionListener(java.awt.event.ActionListener l)
ActionListener to be informed when the user selects
a tab.
l - listener to addpublic void removeActionListener(java.awt.event.ActionListener l)
ActionListener so as to no longer be informed when
the user selects a tab.
l - listener to remove
public void setTitleAt(int i,
java.lang.String title)
i - index of tabtitle - new tab titlepublic void setSelectedTab(int idx)
idx - index of tab to selectpublic int getSelectedTab()
public void setPosition(int position)
Create a tabbed panel with the tabs at the specified position. Can be one of :-
Note, only TOP is currently supported
position - positionpublic void remove(int idx)
remove in class java.awt.Container
public void add(java.awt.Component comp,
java.lang.Object constraints,
int index,
java.awt.Image image)
comp - componentconstraints - tab nameindex - tab indeximage - tab imagepublic int getPosition()
public void removeNotify()
removeNotify in class java.awt.Container
protected void addImpl(java.awt.Component comp,
java.lang.Object constraints,
int index)
addImpl in class java.awt.Container
public void add(java.awt.Component comp,
java.lang.Object constraints,
java.awt.Image image)
public java.awt.Insets getInsets()
getInsets in class java.awt.Containerpublic void addNotify()
addNotify in class java.awt.Containerpublic void paint(java.awt.Graphics g)
paint in class java.awt.Containerpublic static void main(java.lang.String[] args)
public int getSelectedTabIndex()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||