for (File file : getFiles(dir1,"Autoload")) {
listView.getItems().add(new EntitiesFiles(file.getName(),false));
}
listView.setCellFactory(CheckBoxListCell.forListView(new Callback<EntitiesFiles, ObservableValue<Boolean>>() {
@Override
public ObservableValue<Boolean> call(EntitiesFiles item) {
observable = new SimpleBooleanProperty();
observable.addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
if (newValue){
System.out.println(newValue +" true");
}else {
System.out.println(newValue +" false");
}
}
});
return observable;
}
}));