Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Tab

[18:7] extends: FxObj

The Tab class wraps the JavaFX Tab, which represents a single selectable tab within a TabPane. Each Tab holds a label, an optional graphic icon, and a content node that is displayed in the TabPane body when that tab is selected. Tabs can be individually disabled or made non-closable regardless of the TabPane closing policy. Note that Tab does not extend Node or Region in JavaFX -- it is not part of the scene graph on its own. Its visual appearance is controlled entirely through the skin of the owning TabPane and the CSS sub-structure of that skin. Because of this, the standard Node/Region/Control CSS property hierarchy does not apply directly to Tab.

Methods

  • Tab (string Text = "")

    Creates a new Tab with the specified label text.

    • @p Text is a string with the tab label.
  • setText (string Text)

    Sets the tab label text.

    • @p Text is a string with the label.
    • @r this object for chaining
  • getText ()

    Gets the tab label text.

    • @r A string with the label.
  • setContent (object ContentObj)

    Sets the content node displayed when this tab is selected.

    • @p ContentObj is a Node object to display.
    • @r this object for chaining
  • setClosable (bool Closable)

    Sets whether the tab can be closed by the user.

    • @p Closable is a bool with true to allow closing.
    • @r this object for chaining
  • setGraphic (object Graphic)

    Sets a graphic (icon) for the tab.

    • @p Graphic is a Node object to use as the graphic.
    • @r this object for chaining
  • setDisable (bool Disable)

    Sets whether the tab is disabled.

    • @p Disable is a bool with true to disable.
    • @r this object for chaining
  • getContent ()

    Returns the content node displayed when this tab is selected.

    • @r A Node with the current content, or null if none is set.
  • isClosable ()

    Returns whether the tab can be closed by the user.

    • @r A bool with true if the tab is closable.
  • setId (string Id)

    Sets the CSS id of this tab.

    • @p Id is a string with the CSS id.
    • @r this object for chaining
  • setStyle (string Style)

    Sets the inline CSS style string for this tab.

    • @p Style is a string with the CSS style rules.
    • @r this object for chaining
  • onClosed (callback OnClosed)

    Sets a callback for when the tab is closed.

    • @p OnClosed is a callback to call on close.
    • @r this object for chaining
  • setOnSelectionChanged (callback OnChanged)

    Sets a callback that fires when this tab's selected state changes.

    • @p OnChanged is a callback to call on selection change.
    • @r this object for chaining