-1

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?

Milan Novkovic
  • 126
  • 1
  • 2
  • 11
  • 2
    `treeTableColumn.getColumns().remove(columnToRemove)`. But note if you remove the `treeColumn`, it seems the user would not be able to expand/collapse tree nodes (though I don’t know the exact behavior in this case). – James_D Feb 03 '22 at 22:05
  • Also: *”on tabular data where I don’t need drill downs”*. Why not just use a plain `TableView`? – James_D Feb 04 '22 at 00:58
  • @James_D Thanks James. I have a highly functional TreeTable GUI based view builder that can easily define very complex columns. I seldom need just tables so wanted to reuse this module when I do. – Milan Novkovic Feb 04 '22 at 11:14
  • @kleopatra Thanks Kleopatra. This is from an ancient code, very complex but reliable and proven in production - Unix/Motif from 90ties, ported to SWING, now ported to JavaFX, so we follow the old style. And the issue is just in this one line. Pls see my findings below. – Milan Novkovic Feb 04 '22 at 11:16
  • wow, 30 yrs - quite a distance to drag code ;) – kleopatra Feb 04 '22 at 12:22

1 Answers1

-1

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.

Milan Novkovic
  • 126
  • 1
  • 2
  • 11
  • hmm .. this seems to be an extremely unusual issue particular to nothing else but your (possibly suboptimally, at least for javafx) implemented context ;) – kleopatra Feb 04 '22 at 12:17