Top Description Fields Constructors Methods
javafx.scene.control

public Class Tab

extends Object
implements EventTarget, Styleable
Class Inheritance
All Implemented Interfaces
javafx.css.Styleable, javafx.event.EventTarget
Annotations
@DefaultProperty:content
@IDProperty:id
Imports
com.sun.javafx.beans.IDProperty, com.sun.javafx.scene.control.ControlAcceleratorSupport, javafx.collections.ObservableSet, .FXCollections, .ObservableList, .ObservableMap, javafx.css.CssMetaData, .PseudoClass, .Styleable, javafx.beans.property.BooleanProperty, .ObjectProperty, .ObjectPropertyBase, .SimpleBooleanProperty, .SimpleObjectProperty, .SimpleStringProperty, .StringProperty, .BooleanPropertyBase, .ReadOnlyBooleanProperty, .ReadOnlyBooleanWrapper, .ReadOnlyObjectProperty, .ReadOnlyObjectWrapper, javafx.event.Event, .EventDispatchChain, .EventHandler, .EventTarget, .EventType, javafx.scene.Node, com.sun.javafx.event.EventHandlerManager, java.lang.ref.WeakReference, java.util.ArrayList, .Collections, .HashMap, .List, .Set, javafx.beans.DefaultProperty, .InvalidationListener

Tabs are placed within a TabPane, where each tab represents a single 'page'.

Tabs can contain any Node such as UI controls or groups of nodes added to a layout container.

When the user clicks on a Tab in the TabPane the Tab content becomes visible to the user.

Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private BooleanProperty
public static final EventType<Event>
CLOSED_EVENT

Called when a user closes this tab.

private ObjectProperty<Node>
private ObjectProperty<ContextMenu>
private static final String
private BooleanProperty
private ReadOnlyBooleanWrapper
private final EventHandlerManager
private ObjectProperty<Node>
private StringProperty
private ObjectProperty<EventHandler<Event>>
private ObjectProperty<EventHandler<Event>>
onCloseRequest

Called when there is an external request to close this Tab.

private ObjectProperty<EventHandler<Event>>
private final InvalidationListener
private ObservableMap<Object, Object>
private ReadOnlyBooleanWrapper
public static final EventType<Event>
SELECTION_CHANGED_EVENT

Called when the tab becomes selected or unselected.

private StringProperty
private final ObservableList<String>
public static final EventType<Event>
TAB_CLOSE_REQUEST_EVENT

Called when there is an external request to close this Tab.

private ReadOnlyObjectWrapper<TabPane>
private StringProperty
private ObjectProperty<Tooltip>
private static final Object

Constructor Summary

AccessConstructor and Description
public
Tab()

Creates a tab with no title.

public
Tab(String
The title of the tab.
text
)

Creates a tab with a text title.

public
Tab(String
The title of the tab.
text
,
Node
The content of the tab.
content
)

Creates a tab with a text title and the specified content node.

Method Summary

Modifier and TypeMethod and Description
public final <E extends Event> void
addEventFilter(EventType<E>
the type of the events received by the filter
eventType
,
EventHandler<? super E>
the event filter
eventFilter
)

Overrides default javafx.event.EventTarget.addEventFilter.

Registers an event filter for this target.

public final <E extends Event> void
addEventHandler(EventType<E>
the type of the events received by the handler
eventType
,
EventHandler<? super E>
the event handler
eventHandler
)

Overrides default javafx.event.EventTarget.addEventHandler.

Registers an event handler for this target.

public EventDispatchChain
buildEventDispatchChain(EventDispatchChain
the initial chain to build from
tail
)

Implements javafx.event.EventTarget.buildEventDispatchChain.

Construct an event dispatch chain for this target.

public final BooleanProperty

Returns:

the closable property
closableProperty
()

The closable state for this tab.

public final ObjectProperty<Node>

Returns:

the content property
contentProperty
()

The content associated with the tab.

public final ObjectProperty<ContextMenu>

Returns:

the context menu property
contextMenuProperty
()

The context menu associated with the tab.

public final ReadOnlyBooleanProperty

Returns:

the disabled property
disabledProperty
()

Indicates whether or not this Tab is disabled.

private ReadOnlyBooleanWrapper
public final BooleanProperty

Returns:

the disable property
disableProperty
()

Sets the disabled state of this tab.

public static List<CssMetaData<? extends Styleable, ?>>

Returns:

the CssMetaData
getClassCssMetaData
()

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

public final Node

Returns:

The content associated with the tab.
getContent
()

The content associated with the tab.

public final ContextMenu

Returns:

The context menu associated with the tab.
getContextMenu
()

The context menu associated with the tab.

public List<CssMetaData<? extends Styleable, ?>>
getCssMetaData()

Implements javafx.css.Styleable.getCssMetaData.

The CssMetaData of this Styleable.

public final Node

Returns:

The graphic shown in the tab.
getGraphic
()

The graphic shown in the tab.

public final String

Returns:

The id of the tab.
getId
()

Implements javafx.css.Styleable.getId.

The id of this tab.

public final EventHandler<Event>

Returns:

The event handler that is associated with the tab when the tab is closed.
getOnClosed
()

The event handler that is associated with the tab when the tab is closed.

public EventHandler<Event>
public final EventHandler<Event>

Returns:

The event handler that is associated with a tab selection.
getOnSelectionChanged
()

The event handler that is associated with a selection on the tab.

public final ObservableMap<Object, Object>

Returns:

an observable map of properties on this Tab for use primarily by application developers
getProperties
()

Returns an observable map of properties on this Tab for use primarily by application developers.

public final ObservableSet<PseudoClass>
getPseudoClassStates()

Implements javafx.css.Styleable.getPseudoClassStates.

Return the pseudo-class state of this Styleable.

public final String

Returns:

The CSS style string associated to this tab.
getStyle
()

Implements javafx.css.Styleable.getStyle.

The CSS style string associated to this tab.

public Styleable

Returns:

getTabPane()
getStyleableParent
()

Implements javafx.css.Styleable.getStyleableParent.

Return the parent of this Styleable, or null if there is no parent.

public ObservableList<String>
getStyleClass()

Implements javafx.css.Styleable.getStyleClass.

A list of String identifiers which can be used to logically group Nodes, specifically for an external style engine.

public final TabPane

Returns:

the TabPane
getTabPane
()

A reference to the TabPane that contains this tab instance.

public final String

Returns:

The text shown in the tab.
getText
()

The text shown in the tab.

public final Tooltip

Returns:

The tooltip associated with this tab.
getTooltip
()

The tooltip associated with this tab.

public String

Returns:

"Tab"
getTypeSelector
()

Implements javafx.css.Styleable.getTypeSelector.

The type of this Styleable that is to be used in selector matching.

public Object

Returns:

The Object that was previously set, or null if no property has been set or if null was set.
getUserData
()

Returns a previously set Object property, or null if no such property has been set using the Tab#setUserData(java.lang.Object) method.

public final ObjectProperty<Node>

Returns:

The graphic in the tab.
graphicProperty
()

The graphic in the tab.

public boolean

Returns:

true if this tab has properties.
hasProperties
()

Tests if this Tab has properties.

public final StringProperty

Returns:

the id property of this tab
idProperty
()

The id of this tab.

public final boolean

Returns:

true if the tab is closable.
isClosable
()

Returns true if this tab is closable.

public final boolean

Returns:

true if this tab is disable
isDisable
()

Returns true if this tab is disable.

public final boolean

Returns:

true if the TabPane is disabled
isDisabled
()

Returns true when the Tab disable is set to true or if the TabPane is disabled.

public final boolean

Returns:

true if selected
isSelected
()

Represents whether this tab is the currently selected tab, To change the selected Tab use tabPane.getSelectionModel().select()

pack-priv Node
lookup(String selector)

pack-priv List<Node>
lookupAll(String selector)

public final ObjectProperty<EventHandler<Event>>

Returns:

the on closed event handler property
onClosedProperty
()

The event handler that is associated with the tab when the tab is closed.

public final ObjectProperty<EventHandler<Event>>
public final ObjectProperty<EventHandler<Event>>

Returns:

the on selection changed event handler property
onSelectionChangedProperty
()

The event handler that is associated with a selection on the tab.

public final <E extends Event> void
removeEventFilter(EventType<E>
the event type from which to unregister
eventType
,
EventHandler<? super E>
the event filter
eventFilter
)

Overrides default javafx.event.EventTarget.removeEventFilter.

Unregisters a previously registered event filter from this target.

public final <E extends Event> void
removeEventHandler(EventType<E>
the event type from which to unregister
eventType
,
EventHandler<? super E>
the event handler
eventHandler
)

Overrides default javafx.event.EventTarget.removeEventHandler.

Unregisters a previously registered event handler from this target.

public final ReadOnlyBooleanProperty

Returns:

the selected tab
selectedProperty
()

The currently selected tab.

private ReadOnlyBooleanWrapper
public final void
setClosable(boolean
the closable value
value
)

Sets true if the tab is closable.

public final void
setContent(Node
the content node
value
)

The content to show within the main TabPane area.

public final void
setContextMenu(ContextMenu
the context menu
value
)

Specifies the context menu to show when the user right-clicks on the tab.

public final void
setDisable(boolean
the state to set this tab
value
)

Sets the disabled state of this tab.

private final void
setDisabled(boolean value)

pack-priv <E extends Event> void
setEventHandler(EventType<E> eventType, EventHandler<E> eventHandler)

public final void
setGraphic(Node
the graphic node
value
)

Sets the graphic to show in the tab to allow the user to differentiate between the function of each tab.

public final void
setId(String
the id of this tab
value
)

Sets the id of this tab.

public final void
setOnClosed(EventHandler<Event>
the on closed event handler
value
)

Defines a function to be called when the tab is closed.

public void
public final void
setOnSelectionChanged(EventHandler<Event>
the on selection changed event handler
value
)

Defines a function to be called when a selection changed has occurred on the tab.

pack-priv final void
setSelected(boolean value)

public final void
setStyle(String
the style string
value
)

A string representation of the CSS style associated with this tab.

pack-priv final void
public final void
setText(String
the text string
value
)

Sets the text to show in the tab to allow the user to differentiate between the function of each tab.

public final void
setTooltip(Tooltip
the tool tip value
value
)

Specifies the tooltip to show when the user hovers over the tab.

public void
setUserData(Object
The value to be stored - this can later be retrieved by calling Tab#getUserData().
value
)

Convenience method for setting a single Object property that can be retrieved at a later date.

public final StringProperty

Returns:

the CSS style string property associated to this tab
styleProperty
()

The CSS style string associated to this tab.

public final ReadOnlyObjectProperty<TabPane>

Returns:

the TabPane property
tabPaneProperty
()

The TabPane that contains this tab.

private ReadOnlyObjectWrapper<TabPane>
public final StringProperty

Returns:

the text property
textProperty
()

The text shown in the tab.

public final ObjectProperty<Tooltip>

Returns:

the tool tip property
tooltipProperty
()

The tooltip associated with this tab.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

closableback to summary
private BooleanProperty closable
CLOSED_EVENTback to summary
public static final EventType<Event> CLOSED_EVENT

Called when a user closes this tab. This is useful for freeing up memory.

contentback to summary
private ObjectProperty<Node> content
contextMenuback to summary
private ObjectProperty<ContextMenu> contextMenu
DEFAULT_STYLE_CLASSback to summary
private static final String DEFAULT_STYLE_CLASS
disableback to summary
private BooleanProperty disable
disabledback to summary
private ReadOnlyBooleanWrapper disabled
eventHandlerManagerback to summary
private final EventHandlerManager eventHandlerManager
graphicback to summary
private ObjectProperty<Node> graphic
idback to summary
private StringProperty id
onClosedback to summary
private ObjectProperty<EventHandler<Event>> onClosed
onCloseRequestback to summary
private ObjectProperty<EventHandler<Event>> onCloseRequest

Called when there is an external request to close this Tab. The installed event handler can prevent tab closing by consuming the received event.

Since
JavaFX 8.0
onSelectionChangedback to summary
private ObjectProperty<EventHandler<Event>> onSelectionChanged
parentDisabledChangedListenerback to summary
private final InvalidationListener parentDisabledChangedListener
propertiesback to summary
private ObservableMap<Object, Object> properties
selectedback to summary
private ReadOnlyBooleanWrapper selected
SELECTION_CHANGED_EVENTback to summary
public static final EventType<Event> SELECTION_CHANGED_EVENT

Called when the tab becomes selected or unselected.

styleback to summary
private StringProperty style
styleClassback to summary
private final ObservableList<String> styleClass
TAB_CLOSE_REQUEST_EVENTback to summary
public static final EventType<Event> TAB_CLOSE_REQUEST_EVENT

Called when there is an external request to close this Tab. The installed event handler can prevent tab closing by consuming the received event.

Since
JavaFX 8.0
tabPaneback to summary
private ReadOnlyObjectWrapper<TabPane> tabPane
textback to summary
private StringProperty text
tooltipback to summary
private ObjectProperty<Tooltip> tooltip
USER_DATA_KEYback to summary
private static final Object USER_DATA_KEY

Constructor Detail

Tabback to summary
public Tab()

Creates a tab with no title.

Tabback to summary
public Tab(String text)

Creates a tab with a text title.

Parameters
text:String

The title of the tab.

Tabback to summary
public Tab(String text, Node content)

Creates a tab with a text title and the specified content node.

Parameters
text:String

The title of the tab.

content:Node

The content of the tab.

Since
JavaFX 8u40

Method Detail

addEventFilterback to summary
public final <E extends Event> void addEventFilter(EventType<E> eventType, EventHandler<? super E> eventFilter)

Overrides default javafx.event.EventTarget.addEventFilter.

Doc from javafx.event.EventTarget.addEventFilter.

Registers an event filter for this target.

The filter is called when the target receives an Event of the specified type during the capturing phase of event delivery.

Parameters
<E>
the event class of the filter
eventType:EventType<E>

the type of the events received by the filter

eventFilter:EventHandler<? super E>

the event filter

Annotations
@Override
addEventHandlerback to summary
public final <E extends Event> void addEventHandler(EventType<E> eventType, EventHandler<? super E> eventHandler)

Overrides default javafx.event.EventTarget.addEventHandler.

Doc from javafx.event.EventTarget.addEventHandler.

Registers an event handler for this target.

The handler is called when the target receives an Event of the specified type during the bubbling phase of event delivery.

Parameters
<E>
the event class of the handler
eventType:EventType<E>

the type of the events received by the handler

eventHandler:EventHandler<? super E>

the event handler

Annotations
@Override
buildEventDispatchChainback to summary
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail)

Implements javafx.event.EventTarget.buildEventDispatchChain.

Doc from javafx.event.EventTarget.buildEventDispatchChain.

Construct an event dispatch chain for this target. The event dispatch chain contains event dispatchers which might be interested in processing of events targeted at this EventTarget. This event target is not automatically added to the chain, so if it wants to process events, it needs to add an EventDispatcher for itself to the chain.

In the case the event target is part of some hierarchy, the chain for it is usually built from event dispatchers collected from the root of the hierarchy to the event target.

The event dispatch chain is constructed by modifications to the provided initial event dispatch chain. The returned chain should have the initial chain at its end so the dispatchers should be prepended to the initial chain.

The caller shouldn't assume that the initial chain remains unchanged nor that the returned value will reference a different chain.

Parameters
tail:EventDispatchChain

the initial chain to build from

Returns:EventDispatchChain

the resulting event dispatch chain for this target

Annotations
@Override
closablePropertyback to summary
public final BooleanProperty closableProperty()

The closable state for this tab.

Returns:BooleanProperty

the closable property

contentPropertyback to summary
public final ObjectProperty<Node> contentProperty()

The content associated with the tab.

Returns:ObjectProperty<Node>

the content property

contextMenuPropertyback to summary
public final ObjectProperty<ContextMenu> contextMenuProperty()

The context menu associated with the tab.

Returns:ObjectProperty<ContextMenu>

the context menu property

disabledPropertyback to summary
public final ReadOnlyBooleanProperty disabledProperty()

Indicates whether or not this Tab is disabled. A Tab will become disabled if disable is set to true on either itself or if the TabPane is disabled.

Returns:ReadOnlyBooleanProperty

the disabled property

Default Value
false
Since
JavaFX 2.2
disabledPropertyImplback to summary
private ReadOnlyBooleanWrapper disabledPropertyImpl()
disablePropertyback to summary
public final BooleanProperty disableProperty()

Sets the disabled state of this tab. A disable tab is no longer interactive or traversable, but the contents remain interactive. A disable tab can be selected using TabPane#getSelectionModel().

Returns:BooleanProperty

the disable property

Default Value
false
Since
JavaFX 2.2
getClassCssMetaDataback to summary
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData()

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

Returns:List<CssMetaData<? extends Styleable, ?>>

the CssMetaData

Since
JavaFX 8.0
getContentback to summary
public final Node getContent()

The content associated with the tab.

Returns:Node

The content associated with the tab.

getContextMenuback to summary
public final ContextMenu getContextMenu()

The context menu associated with the tab.

Returns:ContextMenu

The context menu associated with the tab.

getCssMetaDataback to summary
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData()

Implements javafx.css.Styleable.getCssMetaData.

Doc from javafx.css.Styleable.getCssMetaData.

The CssMetaData of this Styleable. This may be returned as an unmodifiable list.

Returns:List<CssMetaData<? extends Styleable, ?>>

the CssMetaData

Annotations
@Override
Since
JavaFX 8.0
getGraphicback to summary
public final Node getGraphic()

The graphic shown in the tab.

Returns:Node

The graphic shown in the tab.

getIdback to summary
public final String getId()

Implements javafx.css.Styleable.getId.

The id of this tab.

Returns:String

The id of the tab.

Annotations
@Override
getOnClosedback to summary
public final EventHandler<Event> getOnClosed()

The event handler that is associated with the tab when the tab is closed.

Returns:EventHandler<Event>

The event handler that is associated with the tab when the tab is closed.

getOnCloseRequestback to summary
public EventHandler<Event> getOnCloseRequest()
getOnSelectionChangedback to summary
public final EventHandler<Event> getOnSelectionChanged()

The event handler that is associated with a selection on the tab.

Returns:EventHandler<Event>

The event handler that is associated with a tab selection.

getPropertiesback to summary
public final ObservableMap<Object, Object> getProperties()

Returns an observable map of properties on this Tab for use primarily by application developers.

Returns:ObservableMap<Object, Object>

an observable map of properties on this Tab for use primarily by application developers

Since
JavaFX 2.2
getPseudoClassStatesback to summary
public final ObservableSet<PseudoClass> getPseudoClassStates()

Implements javafx.css.Styleable.getPseudoClassStates.

Doc from javafx.css.Styleable.getPseudoClassStates.

Return the pseudo-class state of this Styleable. CSS assumes this set is read-only.

Returns:ObservableSet<PseudoClass>

the pseudo-class state

Annotations
@Override
Since
JavaFX 8.0
getStyleback to summary
public final String getStyle()

Implements javafx.css.Styleable.getStyle.

The CSS style string associated to this tab.

Returns:String

The CSS style string associated to this tab.

Annotations
@Override
getStyleableParentback to summary
public Styleable getStyleableParent()

Implements javafx.css.Styleable.getStyleableParent.

Doc from javafx.css.Styleable.getStyleableParent.

Return the parent of this Styleable, or null if there is no parent.

Returns:Styleable

getTabPane()

Annotations
@Override
Since
JavaFX 8.0
getStyleClassback to summary
public ObservableList<String> getStyleClass()

Implements javafx.css.Styleable.getStyleClass.

A list of String identifiers which can be used to logically group Nodes, specifically for an external style engine. This variable is analogous to the "class" attribute on an HTML element and, as such, each element of the list is a style class to which this Node belongs.

Returns:ObservableList<String>

Doc from javafx.css.Styleable.getStyleClass.

a list of String identifiers which can be used to logically group Nodes, specifically for an external style engine

Annotations
@Override
See Also
CSS3 class selectors
getTabPaneback to summary
public final TabPane getTabPane()

A reference to the TabPane that contains this tab instance.

Returns:TabPane

the TabPane

getTextback to summary
public final String getText()

The text shown in the tab.

Returns:String

The text shown in the tab.

getTooltipback to summary
public final Tooltip getTooltip()

The tooltip associated with this tab.

Returns:Tooltip

The tooltip associated with this tab.

getTypeSelectorback to summary
public String getTypeSelector()

Implements javafx.css.Styleable.getTypeSelector.

Doc from javafx.css.Styleable.getTypeSelector.

The type of this Styleable that is to be used in selector matching. This is analogous to an "element" in HTML. (CSS Type Selector).

Returns:String

"Tab"

Annotations
@Override
Since
JavaFX 8.0
getUserDataback to summary
public Object getUserData()

Returns a previously set Object property, or null if no such property has been set using the Tab#setUserData(java.lang.Object) method.

Returns:Object

The Object that was previously set, or null if no property has been set or if null was set.

Since
JavaFX 2.2
graphicPropertyback to summary
public final ObjectProperty<Node> graphicProperty()

The graphic in the tab.

Returns:ObjectProperty<Node>

The graphic in the tab.

hasPropertiesback to summary
public boolean hasProperties()

Tests if this Tab has properties.

Returns:boolean

true if this tab has properties.

Since
JavaFX 2.2
idPropertyback to summary
public final StringProperty idProperty()

The id of this tab.

Returns:StringProperty

the id property of this tab

isClosableback to summary
public final boolean isClosable()

Returns true if this tab is closable.

Returns:boolean

true if the tab is closable.

isDisableback to summary
public final boolean isDisable()

Returns true if this tab is disable.

Returns:boolean

true if this tab is disable

Since
JavaFX 2.2
isDisabledback to summary
public final boolean isDisabled()

Returns true when the Tab disable is set to true or if the TabPane is disabled.

Returns:boolean

true if the TabPane is disabled

Since
JavaFX 2.2
isSelectedback to summary
public final boolean isSelected()

Represents whether this tab is the currently selected tab, To change the selected Tab use tabPane.getSelectionModel().select()

Returns:boolean

true if selected

lookupback to summary
pack-priv Node lookup(String selector)
lookupAllback to summary
pack-priv List<Node> lookupAll(String selector)
onClosedPropertyback to summary
public final ObjectProperty<EventHandler<Event>> onClosedProperty()

The event handler that is associated with the tab when the tab is closed.

Returns:ObjectProperty<EventHandler<Event>>

the on closed event handler property

onCloseRequestPropertyback to summary
public final ObjectProperty<EventHandler<Event>> onCloseRequestProperty()
onSelectionChangedPropertyback to summary
public final ObjectProperty<EventHandler<Event>> onSelectionChangedProperty()

The event handler that is associated with a selection on the tab.

Returns:ObjectProperty<EventHandler<Event>>

the on selection changed event handler property

removeEventFilterback to summary
public final <E extends Event> void removeEventFilter(EventType<E> eventType, EventHandler<? super E> eventFilter)

Overrides default javafx.event.EventTarget.removeEventFilter.

Doc from javafx.event.EventTarget.removeEventFilter.

Unregisters a previously registered event filter from this target.

Since it is possible to register a single EventHandler instance for different event types, the caller needs to specify the event type from which the filter should be unregistered.

Parameters
<E>
the event class of the filter
eventType:EventType<E>

the event type from which to unregister

eventFilter:EventHandler<? super E>

the event filter

Annotations
@Override
removeEventHandlerback to summary
public final <E extends Event> void removeEventHandler(EventType<E> eventType, EventHandler<? super E> eventHandler)

Overrides default javafx.event.EventTarget.removeEventHandler.

Doc from javafx.event.EventTarget.removeEventHandler.

Unregisters a previously registered event handler from this target.

Since it is possible to register a single EventHandler instance for different event types, the caller needs to specify the event type from which the handler should be unregistered.

Parameters
<E>
the event class of the handler
eventType:EventType<E>

the event type from which to unregister

eventHandler:EventHandler<? super E>

the event handler

Annotations
@Override
selectedPropertyback to summary
public final ReadOnlyBooleanProperty selectedProperty()

The currently selected tab.

Returns:ReadOnlyBooleanProperty

the selected tab

selectedPropertyImplback to summary
private ReadOnlyBooleanWrapper selectedPropertyImpl()
setClosableback to summary
public final void setClosable(boolean value)

Sets true if the tab is closable. If this is set to false, then regardless of the TabClosingPolicy, it will not be possible for the user to close this tab. Therefore, when this property is false, no 'close' button will be shown on the tab. The default is true.

Parameters
value:boolean

the closable value

setContentback to summary
public final void setContent(Node value)

The content to show within the main TabPane area. The content can be any Node such as UI controls or groups of nodes added to a layout container.

Parameters
value:Node

the content node

setContextMenuback to summary
public final void setContextMenu(ContextMenu value)

Specifies the context menu to show when the user right-clicks on the tab.

Parameters
value:ContextMenu

the context menu

setDisableback to summary
public final void setDisable(boolean value)

Sets the disabled state of this tab.

Parameters
value:boolean

the state to set this tab

Default Value
false
Since
JavaFX 2.2
setDisabledback to summary
private final void setDisabled(boolean value)
setEventHandlerback to summary
pack-priv <E extends Event> void setEventHandler(EventType<E> eventType, EventHandler<E> eventHandler)
setGraphicback to summary
public final void setGraphic(Node value)

Sets the graphic to show in the tab to allow the user to differentiate between the function of each tab. By default the graphic does not rotate based on the TabPane.tabPosition value, but it can be set to rotate by setting TabPane.rotateGraphic to true.

Parameters
value:Node

the graphic node

setIdback to summary
public final void setId(String value)

Sets the id of this tab. This simple string identifier is useful for finding a specific Tab within the TabPane. The default value is null.

Parameters
value:String

the id of this tab

setOnClosedback to summary
public final void setOnClosed(EventHandler<Event> value)

Defines a function to be called when the tab is closed.

Parameters
value:EventHandler<Event>

the on closed event handler

setOnCloseRequestback to summary
public void setOnCloseRequest(EventHandler<Event> value)
setOnSelectionChangedback to summary
public final void setOnSelectionChanged(EventHandler<Event> value)

Defines a function to be called when a selection changed has occurred on the tab.

Parameters
value:EventHandler<Event>

the on selection changed event handler

setSelectedback to summary
pack-priv final void setSelected(boolean value)
setStyleback to summary
public final void setStyle(String value)

A string representation of the CSS style associated with this tab. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.

Parsing this style might not be supported on some limited platforms. It is recommended to use a standalone CSS file instead.

Parameters
value:String

the style string

setTabPaneback to summary
pack-priv final void setTabPane(TabPane value)
setTextback to summary
public final void setText(String value)

Sets the text to show in the tab to allow the user to differentiate between the function of each tab. The text is always visible

Parameters
value:String

the text string

setTooltipback to summary
public final void setTooltip(Tooltip value)

Specifies the tooltip to show when the user hovers over the tab.

Parameters
value:Tooltip

the tool tip value

setUserDataback to summary
public void setUserData(Object value)

Convenience method for setting a single Object property that can be retrieved at a later date. This is functionally equivalent to calling the getProperties().put(Object key, Object value) method. This can later be retrieved by calling Tab#getUserData().

Parameters
value:Object

The value to be stored - this can later be retrieved by calling Tab#getUserData().

Since
JavaFX 2.2
stylePropertyback to summary
public final StringProperty styleProperty()

The CSS style string associated to this tab.

Returns:StringProperty

the CSS style string property associated to this tab

tabPanePropertyback to summary
public final ReadOnlyObjectProperty<TabPane> tabPaneProperty()

The TabPane that contains this tab.

Returns:ReadOnlyObjectProperty<TabPane>

the TabPane property

tabPanePropertyImplback to summary
private ReadOnlyObjectWrapper<TabPane> tabPanePropertyImpl()
textPropertyback to summary
public final StringProperty textProperty()

The text shown in the tab.

Returns:StringProperty

the text property

tooltipPropertyback to summary
public final ObjectProperty<Tooltip> tooltipProperty()

The tooltip associated with this tab.

Returns:ObjectProperty<Tooltip>

the tool tip property

updateDisabledback to summary
private void updateDisabled()