Sorting, Filtering, Searching, Pagination, Selection and Editable Tables
Learn Sorting, Filtering, Searching, Pagination, Selection and Editable Tables (Phase 8 · TableView and Data Handling (Essential), JavaFX) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Sorting, filtering and searching • Click a column header to sort; the table sorts the list through table.getSortOrder() / comparator . For filtering wrap the source list: FilteredList<S> filtered = new FilteredList<>(items, p -> true) , update filtered.setPredicate(...) when the search text changes; for sorting a filtered list wrap in SortedList and bind its comparator to the table's comparator: sorted.comparatorProperty().bind(table.comparatorProperty()) , then table.setItems(sorted) .