This content has been marked as final. Show 4 replies
I suspect your problem is in this line of code:
are you trying to replace the node with fx:id="properties" ? Because if so that's not what this line is doing. You should never try to assign a value to a variable which is injected by the FXMLLoader.
TreeView<String> properties = new TreeView<String>(root);
Instead, in your controller initialize() you should modify the value that was injected, by calling methods on it - e.g.:
Sorry Daniel. I just tried it.
getItems() is not a method of Treeview. Items cannot be added that way.
getChildren() is a protected method and cannot be used to add children(TreeItems) either.
I ran into this problem earlier see my other thread.
Re: Need help making Dynamic Tree Items