Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--gui.TabPanel
Components should be added using add(name,component)); the name is used to label the tab. If you set the layout manager, it should be a subclass of CardLayout. You probably want to setBackground() to a color contrasting that of the parent and the components.
Whenever a card is selected (whether by software or mouse), an event with id = Event.WINDOW_EXPOSE is sent to the selected component. Handling this event may be useful for deferred initialization.
Field Summary | |
int | margin
The width of the margins around the cards. |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
TabPanel()
Creates an empty TabPanel. |
Method Summary | |
java.awt.Component | add(java.lang.String name,
java.awt.Component component)
Add a card, component, to the TabPanel with a given name. |
java.lang.String | documentCard(java.lang.String name)
Return a mouse documentation string for selecting this card. (ie. the applet status line (if there is an applet), for when the mouse is over the tab). |
void | first()
Select the first card in the Panel. |
boolean | handleEvent(java.awt.Event e)
Handle mouse clicks and documentation line for Tab selection. |
java.awt.Insets | insets()
Allocates extra margins to give the cards some `body'. |
void | last()
Select the last card in the Panel. |
void | layout()
Computes tab geometry while laying out the panels components. |
void | next()
Select the next card in the Panel. |
void | paint(java.awt.Graphics g)
Paint the tabs in a row atop the cards. |
void | previous()
Select the previous card in the Panel. |
void | removeAll()
remove all cards from the TabPanel. |
void | remove(java.awt.Component component)
remove the card, component, from the TabPanel. |
void | remove(java.lang.String name)
remove the card having the given name from the TabPanel. |
void | setTabFont(java.awt.Font font)
Specify the Font to be used for labeling the Tabs. |
void | show(java.lang.String name)
Select the named card in the Panel. |
void | show(java.awt.Component component)
Select the card component in the Panel. |
Methods inherited from class java.awt.Panel | |
addNotify |
Methods inherited from class java.awt.Container | |
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
public int margin
Constructor Detail |
public TabPanel()
Method Detail |
public java.awt.Component add(java.lang.String name, java.awt.Component component)
public void remove(java.awt.Component component)
public void remove(java.lang.String name)
public void removeAll()
public void first()
public void last()
public void next()
public void previous()
public void show(java.lang.String name)
public void show(java.awt.Component component)
public java.lang.String documentCard(java.lang.String name)
public boolean handleEvent(java.awt.Event e)
public java.awt.Insets insets()
public void setTabFont(java.awt.Font font)
public void layout()
public void paint(java.awt.Graphics g)
Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |