Can tree column be hidden programmatically in TreeTableView of JavaFX?

128 Views Asked by At

I have a useful TreeTableView GUI view definition builder and would like to use in on tabular data where I don't need drill downs. I tried ...

m_treeTableView.getTreeColumn().setVisible(false);

... but it doesn't hide the tree column. Any help?

1

There are 1 best solutions below

1
Milan Novkovic On

getTreeColumn appears to be returning null regardless of the thread or delayed execution I call it from. However, the column exists at index zero in the TreeTableView vector of columns. Hiding it by index works fine but gives unpredictable results if drill-down is defined.

However, TreeTableView hides the column automatically and elegantly if no drill-down is defined - logical behaviour and exactly what I need.

Edit: getTreeColumn returns null even if the column is not null, but is at its default position, leftmost place. Otherwise it returns the column.