Overview
JTabs is a flexible tab component that extends JavaFX’s BorderPane. It supports multiple visual styles (line, pills), tab positioning (top, bottom, left, right), and custom tab content with titles, descriptions, and icons.
Enumerations
TabStyle
Line-style tabs with an underline indicator
Pill-style tabs with rounded backgrounds
Constructor
Creates a new tab container with default settings (LINE style, TOP position).
Methods
Tab Management
Returns the observable list of tabs.
Programmatically selects a tab.
Style Configuration
Gets the current tab style.
Sets the visual style of the tabs.
Property for the tab style.
Position Configuration
Gets the current tab position.
Sets the position of the tab headers.
Property for the tab position.
Related Components
- JTab - Individual tab data objects for use within JTabs
Style Classes
Base style class applied to the tabs container
Applied when using LINE tab style
Applied when using PILLS tab style
Applied to the container holding tab headers
Applied to the container holding tab content
Applied to individual tab headers
Applied to the currently selected tab header
Applied to tab title labels
Applied to tab description labels
Example Usage
Behavior Notes
- Only one tab can be selected at a time
- When tabs are positioned on TOP or BOTTOM, headers are horizontally scrollable if needed
- When tabs are positioned on LEFT or RIGHT, headers are vertically arranged
- Disabled tabs cannot be selected
- The first tab is automatically selected when tabs are added to an empty container
- Tab descriptions are only visible when set and non-empty
Source
com.jjarroyo.components.JTabs in JTabs.java:22
JTab
Overview
JTab is a data model class representing an individual tab within a JTabs container. It holds the tab’s title, description, content, icon, and disabled state.
Constructor
Creates an empty tab.
Creates a tab with title and content.
Creates a tab with title, description, and content.
Properties
Title
Property for the tab title.
Gets the tab title.
Sets the tab title.
Description
Property for the tab description.
Gets the tab description.
Sets the tab description.
Content
Property for the tab content.
Gets the tab content.
Sets the tab content.
Graphic
Property for the tab icon/graphic.
Gets the tab graphic.
Sets the tab graphic (typically an icon).
Disable
Property for the tab disabled state.
Checks if the tab is disabled.
Sets whether the tab is disabled.
Source
com.jjarroyo.components.JTab in JTab.java:9