There is a list of BooleanProperty:

private final ObservableList<BooleanProperty> booleanList = FXCollections.observableArrayList(); 

It is necessary that when the state of an instance of a BooleanProperty changes (for example,

  BooleanProperty flag1 = new SimpleBooleanProperty(false) ... flag1.set(true) и т.д.) 

false to true or vice versa the listener was triggered. I tried this way, it does not work:

  booleanList.addListener((ListChangeListener .Change<? extends BooleanProperty> change) -> { System.out.println("!!!"); }); 

    1 answer 1

    Add a listener to SimpleBooleanProperty like this

     BooleanProperty flag1 = new SimpleBooleanProperty(false); flag1.addListener((observable, oldValue, newValue) -> { System.out.println("Новое значение " + newValue); }); flag1.set(true); 

    Or change the list itself

     ObservableList<BooleanProperty> booleanList = FXCollections.observableArrayList(); booleanList.addListener((ListChangeListener<BooleanProperty>) c -> System.out.println("Список изменился")); booleanList.add(flag1);