I have a property which wraps an ObservableList
. But I cannot figure out how to initialize it. Currently I am doing it like this
ObjectProperty<ObservableList<T>> property = new ChoiceBox<T>().itemsProperty();
which is obviously totally bad practice. Another one was
ObjectProperty<ObservableList<T>> property = new SimpleObjectProperty<ObservableList<T>>();
but this needs later attention which I try to avoid to initialize the internal ObservableList with an empty List.
I search for something like this
ObjectProperty<ObservableList<T>> property = new SimpleObjectProperty<ObservableList<T>>(new ObservableList<T>());