Overview
JTable is a feature-rich table component built on JavaFX TableView with advanced capabilities including:- Checkbox selection with header “select all” control
- Built-in search and filtering across columns
- Custom cell renderers for rich content
- Row actions column with custom buttons/controls
- Bulk actions toolbar for multi-row operations
- CSV export functionality
- Pagination with customizable items per page
- Infinite scroll support
- Empty state customization
- Striped and dense visual modes
Constructor
Creates a new generic table for type T.
Basic Usage
Column Configuration
Adds a sortable column with the specified title and property name.
Adds a column with control over sortability.
Adds a column with a custom cell renderer.
Adds a column with custom renderer and sortability control.
Checkable Mode
Enables or disables checkbox selection mode. When enabled, adds a checkbox column with header “select all” control.
Returns whether checkbox mode is enabled.
Returns the list of currently checked items.
Returns the indices of checked items in the original data list.
Clears all checkbox selections and resets header checkbox state.
Sets a callback that fires when the checked items selection changes.
Search and Filter
Enables or disables the search bar. Automatically filters across all column properties.
Returns whether search mode is enabled.
Sets the placeholder text for the search field (default: “Buscar…”).
Row Actions
Sets a factory function to create action buttons/controls for each row.
Row Click
Sets a callback that fires when a table row is clicked.
Bulk Actions
Enables or disables the bulk actions toolbar (requires checkable mode).
Sets a callback for bulk delete action and automatically enables bulk actions.
Data Management
Sets the table’s data source.
Returns the current items list.
Sets the number of items per page for pagination (default: 10).
Adds a single item to the table.
Removes a single item from the table and checked items list.
Removes multiple items from the table and checked items list.
Refreshes the table display, reapplying filters and updating the view.
Empty State
Sets the text displayed when the table has no data.
Sets a custom graphic/icon for the empty state.
Visual Modes
Enables or disables striped row styling (alternating row colors).
Returns whether striped mode is enabled.
Enables or disables dense mode (compact row spacing).
Returns whether dense mode is enabled.
Status Bar
Enables or disables the status bar showing “Showing X to Y of Z results”.
Pagination
Shows or hides the pagination controls.
Returns the underlying JPagination component for advanced control.
Infinite Scroll
Sets a callback that fires when the user scrolls to the bottom of the table.
CSV Export
Exports all table data to a CSV file.
Access to Underlying Components
Returns the underlying JavaFX TableView for advanced customization.