1

I searched on SO, but only found posts regarding sorting TreeView, e.g., JavaFX: TableView: Arrow for a column sorted by default and Javafx: Re-sorting a column in a TableView.

Both don't seem to work with my TreeTableView.

Also Oracle's blog post on Tree Table Views (see Example 15-4: Sorting Mode Settings) does not really help.

I think it should be some combination of

row.setSortType(...)

and

table.setSortMode(...)

and

table.sort()

and

table.getSortOrder(). ...

and

table.getSortPolicy(). ...

yet I could not get it working.

What I want to achive:

  1. Define columns & add them to the table (Works fine)
  2. Set default sort (e.g., sort data by "valueColumn" descending) (How?)
  3. Set root (Works, but does not get sorted at the moment)
Pavel_K
  • 8,216
  • 6
  • 44
  • 127
Markus Weninger
  • 8,844
  • 4
  • 47
  • 112

0 Answers0