I want to bind a value to the ObservableList
's size to know its size and also to know if it has multiple values
private ObservableList<String> strings = FXCollections.observableArrayList();
They can be bound with the Bindings
class:
ObservableList<String> strings = FXCollections.observableArrayList();
IntegerBinding sizeProperty = Bindings.size(strings);
BooleanBinding multipleElemsProperty = new BooleanBinding() {
@Override protected boolean computeValue() {
return strings.size() > 1;
}
};