Answer the question
In order to leave comments, you need to log in
How to name an element in such a list?
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;
}
}));
Answer the question
In order to leave comments, you need to log in
Maybe,
listView.getItems().get(elemNumber).name = "newName";
?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question