@BeanSettings(acceptChildren=true, useXdevCustomizer=true) public class XdevTab extends JPanel implements DistinctChild, XdevFocusCycleController
JTabbedPane
displaying a given
title and/or icon. A tab is represented by an index corresponding to the
position it was added in, where the first tab has an index equal to 0 and the
last tab has an index equal to the tab count minus 1.
The TabbedPane
uses a SingleSelectionModel
to
represent the set of tab indices and the currently selected index. If the tab
count is greater than 0, then there will always be a selected index, which by
default will be initialized to the first tab. If the tab count is 0, then the
selected index will be -1.
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
XdevTab()
Creates a new
XdevTab . |
XdevTab(int index)
Deprecated.
index is automatically set by
JTabbedPane |
XdevTab(int index,
LayoutManager layout)
Deprecated.
index is automatically set by
JTabbedPane |
XdevTab(LayoutManager layout)
Creates a new
XdevTab with the specified layout manager and
index. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Removes this tab from its parent.
|
Component |
getFocusComponentAfter()
|
Component |
getFocusComponentBefore()
|
Icon |
getIcon()
Returns the tab icon.
|
int |
getIndex()
Returns the index of this tab in the
JTabbedPane . |
String |
getText()
Returns the tab title.
|
String |
getTitle()
Returns the tab title.
|
boolean |
isSelected()
Checks if this tab is the current selected tab in the
JTabbedPane
parent. |
void |
setEnabled(boolean b) |
void |
setFont(Font font) |
void |
setForeground(Color fg) |
void |
setIcon(Icon icon)
Sets the icon
icon which can be null . |
void |
setIndex(int index)
Sets the index of this tab to
index . |
void |
setTitle(String title)
Sets the title to
title which can be null . |
void |
setToolTipText(String text) |
String |
toString() |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
public XdevTab()
XdevTab
.public XdevTab(LayoutManager layout)
XdevTab
with the specified layout manager and
index.layout
- the LayoutManager to use@Deprecated public XdevTab(int index)
JTabbedPane
XdevTab
with the specified index.index
- the index of the tab in the JTabbedPane
@Deprecated public XdevTab(int index, LayoutManager layout)
JTabbedPane
XdevTab
with the specified layout manager and
index.index
- the index of the tab in the JTabbedPane
layout
- the LayoutManager to usepublic void setIndex(int index)
index
.
This method is not intended to be called by the user. The index
is set automatically by the JTabbedPane
!
index
- the tab index where this tab is being placed in the
JTabbedPane
public int getIndex()
JTabbedPane
.JTabbedPane
public void setTitle(String title)
title
which can be null
.title
- the title for this tab to be displayed.getTitle()
public String getText()
getTitle()
public String getTitle()
setTitle(String)
public void setIcon(Icon icon)
icon
which can be null
.icon
- the icon to be displayed in the tab. If icon
is
null no icon will be displayed.getIcon()
public Icon getIcon()
index
setIcon(Icon)
public void setToolTipText(String text)
setToolTipText
in class JComponent
public void setEnabled(boolean b)
setEnabled
in class JComponent
public boolean isSelected()
JTabbedPane
parent.isSelected
in interface DistinctChild
true
if this tab is the current selected tab in the
JTabbedPane
parent, false
otherwisepublic void close()
To re-add the tab use XdevTabbedPane.addTab(XdevTab)
.
public Component getFocusComponentAfter()
getFocusComponentAfter
in interface XdevFocusCycleController
Component
after this Component
in the
XdevFoucsCycle.public Component getFocusComponentBefore()
getFocusComponentBefore
in interface XdevFocusCycleController
Component
before this Component
in the
XdevFoucsCycle.public void setForeground(Color fg)
setForeground
in class JComponent
public void setFont(Font font)
setFont
in class JComponent
Copyright © 2003–2021 XDEV Software. All rights reserved.