Nigel Eke - Personal Site

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.

Posted: June 05, 2012