2

I am trying to implement a ScalaFX TreeView representing a directory structure, with some TreeItem elements in the tree structure able to capture a MouseClicked event so that I can do further operations (subsequently show the contents of that directory). It seems that the only way to catch events is to adopt CellFactory in this relation. I am not sure how to get my head around this with such limited available documentation (even in JavaFX side).

Any pointers to code fragments addressing this type of scenario?

0009laH
  • 1,960
  • 13
  • 27
  • 1
    [That request](https://stackoverflow.com/a/38279168/6538278) may be useful for you; Fabian provides a solution where `setCellFactory` has a minimal implementation in the code. If you want an example of how to use `CellFactory`, I think [this request](https://stackoverflow.com/a/34839491/6538278) would give a good overview – 0009laH Jan 25 '21 at 08:59
  • Those are JavaFX implementations and I'm sure helpful in that context. I'm keen to understand how ScalaFX addresses TreeItem with custom events, hence (according to documentation) require CellFactory somehow connected with subset of TreeItems (ie. leaf nodes of the structure). –  Jan 25 '21 at 20:56

0 Answers0