JavaFX TreeItem getChildren

Take a JavafX TreeItem:

TreeItem<Foo> fooTreeItem = new TreeItem<>(aFoo);

Why does the API for getChildren() insist on returning a list of TreeItem<Foo>?

From the API for TreeItem<T>:

ObservableList<T> getChildren() // The children of this TreeItem.

However this example shows TreeItem<Bar> being added as children.

Leave a Reply

Your email address will not be published. Required fields are marked *