Class FlatTabbedPane
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JTabbedPane
-
- com.formdev.flatlaf.extras.components.FlatTabbedPane
-
- All Implemented Interfaces:
FlatComponentExtension
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
,javax.swing.SwingConstants
public class FlatTabbedPane extends javax.swing.JTabbedPane implements FlatComponentExtension
Subclass ofJTabbedPane
that provides easy access to FlatLaf specific client properties.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FlatTabbedPane.ScrollButtonsPlacement
static class
FlatTabbedPane.ScrollButtonsPolicy
static class
FlatTabbedPane.TabAlignment
static class
FlatTabbedPane.TabAreaAlignment
static class
FlatTabbedPane.TabsPopupPolicy
static class
FlatTabbedPane.TabWidthMode
-
Nested classes/interfaces inherited from class javax.swing.JTabbedPane
javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTabbedPane.ModelListener
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
-
Fields inherited from class javax.swing.JTabbedPane
changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description FlatTabbedPane()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Component
getLeadingComponent()
Returns a component that will be placed at the leading edge of the tabs area.int
getMaximumTabWidth()
Returns the maximum width of a tab.int
getMaximumTabWidth(int tabIndex)
Returns the maximum width of the tab at the given tab index.int
getMinimumTabWidth()
Returns the minimum width of a tab.int
getMinimumTabWidth(int tabIndex)
Returns the minimum width of the tab at the given tab index.FlatTabbedPane.ScrollButtonsPlacement
getScrollButtonsPlacement()
Returns the placement of the forward/backward scroll arrow buttons.FlatTabbedPane.ScrollButtonsPolicy
getScrollButtonsPolicy()
Returns the display policy for the forward/backward scroll arrow buttons.FlatTabbedPane.TabAlignment
getTabAlignment()
Returns the horizontal alignment of the tab title and icon.FlatTabbedPane.TabAreaAlignment
getTabAreaAlignment()
Returns the alignment of the tab area.java.awt.Insets
getTabAreaInsets()
Returns the insets of the tab area.java.util.function.BiConsumer<javax.swing.JTabbedPane,java.lang.Integer>
getTabCloseCallback()
Returns the callback that is invoked when a tab close button is clicked.java.util.function.BiConsumer<javax.swing.JTabbedPane,java.lang.Integer>
getTabCloseCallback(int tabIndex)
Returns the callback that is invoked when the tab close button at the given tab index is clicked.java.lang.String
getTabCloseToolTipText()
Returns the tooltip text used for tab close buttons.java.lang.String
getTabCloseToolTipText(int tabIndex)
Returns the tooltip text used for tab close button at the given tab index.int
getTabHeight()
Returns the minimum height of a tab.int
getTabIconPlacement()
Returns the tab icon placement (relative to tab title).java.awt.Insets
getTabInsets()
Returns the insets of a tab.java.awt.Insets
getTabInsets(int tabIndex)
Returns the insets of the tab at the given tab index.FlatTabbedPane.TabsPopupPolicy
getTabsPopupPolicy()
Returns the display policy for the "more tabs" button, which shows a popup menu with the (partly) hidden tabs.FlatTabbedPane.TabWidthMode
getTabWidthMode()
Returns how the tabs should be sized.java.awt.Component
getTrailingComponent()
Returns a component that will be placed at the trailing edge of the tabs area.boolean
isHasFullBorder()
Returns whether a full border is painted around a tabbed pane.boolean
isHideTabAreaWithOneTab()
Returns whether the tab area should be hidden if it contains only one tab.boolean
isShowContentSeparators()
Returns whether the separator between tabs area and content area should be shown.boolean
isShowTabSeparators()
Returns whether separators are shown between tabs.java.lang.Boolean
isTabClosable(int tabIndex)
Returns whether the tab at the given tab index is closable.boolean
isTabsClosable()
Returns whether all tabs are closable.void
setHasFullBorder(boolean hasFullBorder)
Specifies whether a full border is painted around a tabbed pane.void
setHideTabAreaWithOneTab(boolean hideTabAreaWithOneTab)
Specifies whether the tab area should be hidden if it contains only one tab.void
setLeadingComponent(java.awt.Component leadingComponent)
Specifies a component that will be placed at the leading edge of the tabs area.void
setMaximumTabWidth(int maximumTabWidth)
Specifies the maximum width of a tab.void
setMaximumTabWidth(int tabIndex, int maximumTabWidth)
Specifies the maximum width of the tab at the given tab index.void
setMinimumTabWidth(int minimumTabWidth)
Specifies the minimum width of a tab.void
setMinimumTabWidth(int tabIndex, int minimumTabWidth)
Specifies the minimum width of the tab at the given tab index.void
setScrollButtonsPlacement(FlatTabbedPane.ScrollButtonsPlacement scrollButtonsPlacement)
Specifies the placement of the forward/backward scroll arrow buttons.void
setScrollButtonsPolicy(FlatTabbedPane.ScrollButtonsPolicy scrollButtonsPolicy)
Specifies the display policy for the forward/backward scroll arrow buttons.void
setShowContentSeparators(boolean showContentSeparators)
Specifies whether the separator between tabs area and content area should be shown.void
setShowTabSeparators(boolean showTabSeparators)
Specifies whether separators are shown between tabs.void
setTabAlignment(FlatTabbedPane.TabAlignment tabAlignment)
Specifies the horizontal alignment of the tab title and icon.void
setTabAreaAlignment(FlatTabbedPane.TabAreaAlignment tabAreaAlignment)
Specifies the alignment of the tab area.void
setTabAreaInsets(java.awt.Insets tabAreaInsets)
Specifies the insets of the tab area.void
setTabClosable(int tabIndex, boolean tabClosable)
Specifies whether the tab at the given tab index is closable.void
setTabCloseCallback(int tabIndex, java.util.function.BiConsumer<javax.swing.JTabbedPane,java.lang.Integer> tabCloseCallback)
Specifies the callback that is invoked when the tab close button at the given tab index is clicked.void
setTabCloseCallback(java.util.function.BiConsumer<javax.swing.JTabbedPane,java.lang.Integer> tabCloseCallback)
Specifies the callback that is invoked when a tab close button is clicked.void
setTabCloseToolTipText(int tabIndex, java.lang.String tabCloseToolTipText)
Specifies the tooltip text used for tab close button at the given tab index.void
setTabCloseToolTipText(java.lang.String tabCloseToolTipText)
Specifies the tooltip text used for tab close buttons.void
setTabHeight(int tabHeight)
Specifies the minimum height of a tab.void
setTabIconPlacement(int tabIconPlacement)
Specifies the tab icon placement (relative to tab title).void
setTabInsets(int tabIndex, java.awt.Insets tabInsets)
Specifies the insets of the tab at the given tab index.void
setTabInsets(java.awt.Insets tabInsets)
Specifies the insets of a tab.void
setTabsClosable(boolean tabClosable)
Specifies whether all tabs are closable.void
setTabsPopupPolicy(FlatTabbedPane.TabsPopupPolicy tabsPopupPolicy)
Specifies the display policy for the "more tabs" button, which shows a popup menu with the (partly) hidden tabs.void
setTabWidthMode(FlatTabbedPane.TabWidthMode tabWidthMode)
Specifies how the tabs should be sized.void
setTrailingComponent(java.awt.Component trailingComponent)
Specifies a component that will be placed at the trailing edge of the tabs area.-
Methods inherited from class javax.swing.JTabbedPane
add, add, add, add, add, addChangeListener, addTab, addTab, addTab, createChangeListener, fireStateChanged, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabComponentAt, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, getUI, getUIClassID, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, indexOfTabComponent, insertTab, isEnabledAt, paramString, remove, remove, removeAll, removeChangeListener, removeTabAt, setBackgroundAt, setComponentAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setSelectedIndex, setTabComponentAt, setTabLayoutPolicy, setTabPlacement, setTitleAt, setToolTipTextAt, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
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, 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, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, 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, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.formdev.flatlaf.extras.components.FlatComponentExtension
getClientProperty, getClientPropertyBoolean, getClientPropertyBoolean, getClientPropertyColor, getClientPropertyEnumString, getClientPropertyInsets, getClientPropertyInt, getClientPropertyInt, putClientProperty, putClientPropertyBoolean, putClientPropertyEnumString
-
-
-
-
Method Detail
-
isShowTabSeparators
public boolean isShowTabSeparators()
Returns whether separators are shown between tabs.
-
setShowTabSeparators
public void setShowTabSeparators(boolean showTabSeparators)
Specifies whether separators are shown between tabs.
-
isShowContentSeparators
public boolean isShowContentSeparators()
Returns whether the separator between tabs area and content area should be shown.
-
setShowContentSeparators
public void setShowContentSeparators(boolean showContentSeparators)
Specifies whether the separator between tabs area and content area should be shown.
-
isHasFullBorder
public boolean isHasFullBorder()
Returns whether a full border is painted around a tabbed pane.
-
setHasFullBorder
public void setHasFullBorder(boolean hasFullBorder)
Specifies whether a full border is painted around a tabbed pane.
-
isHideTabAreaWithOneTab
public boolean isHideTabAreaWithOneTab()
Returns whether the tab area should be hidden if it contains only one tab.
-
setHideTabAreaWithOneTab
public void setHideTabAreaWithOneTab(boolean hideTabAreaWithOneTab)
Specifies whether the tab area should be hidden if it contains only one tab.
-
getMinimumTabWidth
public int getMinimumTabWidth()
Returns the minimum width of a tab.
-
setMinimumTabWidth
public void setMinimumTabWidth(int minimumTabWidth)
Specifies the minimum width of a tab.
-
getMinimumTabWidth
public int getMinimumTabWidth(int tabIndex)
Returns the minimum width of the tab at the given tab index.
-
setMinimumTabWidth
public void setMinimumTabWidth(int tabIndex, int minimumTabWidth)
Specifies the minimum width of the tab at the given tab index.
-
getMaximumTabWidth
public int getMaximumTabWidth()
Returns the maximum width of a tab.
-
setMaximumTabWidth
public void setMaximumTabWidth(int maximumTabWidth)
Specifies the maximum width of a tab.Applied only if tab does not have a custom tab component (see
JTabbedPane.setTabComponentAt(int, java.awt.Component)
).
-
getMaximumTabWidth
public int getMaximumTabWidth(int tabIndex)
Returns the maximum width of the tab at the given tab index.
-
setMaximumTabWidth
public void setMaximumTabWidth(int tabIndex, int maximumTabWidth)
Specifies the maximum width of the tab at the given tab index.Applied only if tab does not have a custom tab component (see
JTabbedPane.setTabComponentAt(int, java.awt.Component)
).
-
getTabHeight
public int getTabHeight()
Returns the minimum height of a tab.
-
setTabHeight
public void setTabHeight(int tabHeight)
Specifies the minimum height of a tab.- See Also:
setTabInsets(Insets)
-
getTabInsets
public java.awt.Insets getTabInsets()
Returns the insets of a tab.
-
setTabInsets
public void setTabInsets(java.awt.Insets tabInsets)
Specifies the insets of a tab.- See Also:
setTabHeight(int)
-
getTabInsets
public java.awt.Insets getTabInsets(int tabIndex)
Returns the insets of the tab at the given tab index.
-
setTabInsets
public void setTabInsets(int tabIndex, java.awt.Insets tabInsets)
Specifies the insets of the tab at the given tab index.- See Also:
setTabHeight(int)
-
getTabAreaInsets
public java.awt.Insets getTabAreaInsets()
Returns the insets of the tab area.
-
setTabAreaInsets
public void setTabAreaInsets(java.awt.Insets tabAreaInsets)
Specifies the insets of the tab area.
-
isTabsClosable
public boolean isTabsClosable()
Returns whether all tabs are closable.
-
setTabsClosable
public void setTabsClosable(boolean tabClosable)
Specifies whether all tabs are closable. If set totrue
, all tabs in that tabbed pane are closable. To make individual tabs closable, usesetTabClosable(int, boolean)
.Note that you have to specify a callback (see
setTabCloseCallback(BiConsumer)
) that is invoked when the user clicks a tab close button. The callback is responsible for closing the tab.
-
isTabClosable
public java.lang.Boolean isTabClosable(int tabIndex)
Returns whether the tab at the given tab index is closable.
-
setTabClosable
public void setTabClosable(int tabIndex, boolean tabClosable)
Specifies whether the tab at the given tab index is closable. To make all tabs closable, usesetTabsClosable(boolean)
.Note that you have to specify a callback (see
setTabCloseCallback(BiConsumer)
) that is invoked when the user clicks a tab close button. The callback is responsible for closing the tab.
-
getTabCloseToolTipText
public java.lang.String getTabCloseToolTipText()
Returns the tooltip text used for tab close buttons.
-
setTabCloseToolTipText
public void setTabCloseToolTipText(java.lang.String tabCloseToolTipText)
Specifies the tooltip text used for tab close buttons.
-
getTabCloseToolTipText
public java.lang.String getTabCloseToolTipText(int tabIndex)
Returns the tooltip text used for tab close button at the given tab index.
-
setTabCloseToolTipText
public void setTabCloseToolTipText(int tabIndex, java.lang.String tabCloseToolTipText)
Specifies the tooltip text used for tab close button at the given tab index.
-
getTabCloseCallback
public java.util.function.BiConsumer<javax.swing.JTabbedPane,java.lang.Integer> getTabCloseCallback()
Returns the callback that is invoked when a tab close button is clicked. The callback is responsible for closing the tab.
-
setTabCloseCallback
public void setTabCloseCallback(java.util.function.BiConsumer<javax.swing.JTabbedPane,java.lang.Integer> tabCloseCallback)
Specifies the callback that is invoked when a tab close button is clicked. The callback is responsible for closing the tab.Use a
BiConsumer
<javax.swing.JTabbedPane, Integer> that receives the tabbed pane and the tab index as parameters:
If you need to check whether a modifier key (e.g. Alt or Shift) was pressed while the user clicked the tab close button, usemyTabbedPane.setTabCloseCallback( (tabbedPane, tabIndex) -> { // close tab here } );
EventQueue.getCurrentEvent()
to get current event, check whether it is aMouseEvent
and invoke its methods. E.g.AWTEvent e = EventQueue.getCurrentEvent(); boolean shift = (e instanceof MouseEvent) ? ((MouseEvent)e).isShiftDown() : false;
-
getTabCloseCallback
public java.util.function.BiConsumer<javax.swing.JTabbedPane,java.lang.Integer> getTabCloseCallback(int tabIndex)
Returns the callback that is invoked when the tab close button at the given tab index is clicked. The callback is responsible for closing the tab.
-
setTabCloseCallback
public void setTabCloseCallback(int tabIndex, java.util.function.BiConsumer<javax.swing.JTabbedPane,java.lang.Integer> tabCloseCallback)
Specifies the callback that is invoked when the tab close button at the given tab index is clicked. The callback is responsible for closing the tab.- See Also:
setTabCloseCallback(BiConsumer)
-
getTabsPopupPolicy
public FlatTabbedPane.TabsPopupPolicy getTabsPopupPolicy()
Returns the display policy for the "more tabs" button, which shows a popup menu with the (partly) hidden tabs.
-
setTabsPopupPolicy
public void setTabsPopupPolicy(FlatTabbedPane.TabsPopupPolicy tabsPopupPolicy)
Specifies the display policy for the "more tabs" button, which shows a popup menu with the (partly) hidden tabs.
-
getScrollButtonsPolicy
public FlatTabbedPane.ScrollButtonsPolicy getScrollButtonsPolicy()
Returns the display policy for the forward/backward scroll arrow buttons.
-
setScrollButtonsPolicy
public void setScrollButtonsPolicy(FlatTabbedPane.ScrollButtonsPolicy scrollButtonsPolicy)
Specifies the display policy for the forward/backward scroll arrow buttons.
-
getScrollButtonsPlacement
public FlatTabbedPane.ScrollButtonsPlacement getScrollButtonsPlacement()
Returns the placement of the forward/backward scroll arrow buttons.
-
setScrollButtonsPlacement
public void setScrollButtonsPlacement(FlatTabbedPane.ScrollButtonsPlacement scrollButtonsPlacement)
Specifies the placement of the forward/backward scroll arrow buttons.
-
getTabAreaAlignment
public FlatTabbedPane.TabAreaAlignment getTabAreaAlignment()
Returns the alignment of the tab area.
-
setTabAreaAlignment
public void setTabAreaAlignment(FlatTabbedPane.TabAreaAlignment tabAreaAlignment)
Specifies the alignment of the tab area.
-
getTabAlignment
public FlatTabbedPane.TabAlignment getTabAlignment()
Returns the horizontal alignment of the tab title and icon.
-
setTabAlignment
public void setTabAlignment(FlatTabbedPane.TabAlignment tabAlignment)
Specifies the horizontal alignment of the tab title and icon.
-
getTabWidthMode
public FlatTabbedPane.TabWidthMode getTabWidthMode()
Returns how the tabs should be sized.
-
setTabWidthMode
public void setTabWidthMode(FlatTabbedPane.TabWidthMode tabWidthMode)
Specifies how the tabs should be sized.
-
getTabIconPlacement
public int getTabIconPlacement()
Returns the tab icon placement (relative to tab title).
-
setTabIconPlacement
public void setTabIconPlacement(int tabIconPlacement)
Specifies the tab icon placement (relative to tab title).Allowed Values are:
SwingConstants.LEADING
(default)SwingConstants.TRAILING
SwingConstants.TOP
SwingConstants.BOTTOM
-
getLeadingComponent
public java.awt.Component getLeadingComponent()
Returns a component that will be placed at the leading edge of the tabs area.
-
setLeadingComponent
public void setLeadingComponent(java.awt.Component leadingComponent)
Specifies a component that will be placed at the leading edge of the tabs area.For top and bottom tab placement, the layed out component size will be the preferred component width and the tab area height.
For left and right tab placement, the layed out component size will be the tab area width and the preferred component height.
-
getTrailingComponent
public java.awt.Component getTrailingComponent()
Returns a component that will be placed at the trailing edge of the tabs area.
-
setTrailingComponent
public void setTrailingComponent(java.awt.Component trailingComponent)
Specifies a component that will be placed at the trailing edge of the tabs area.For top and bottom tab placement, the layed out component size will be the available horizontal space (minimum is preferred component width) and the tab area height.
For left and right tab placement, the layed out component size will be the tab area width and the available vertical space (minimum is preferred component height).
-
-