I finally managed to track whenever a click happens on a checkbox in my GUI. But now it won't load the correct value of the CheckBox into the gui. Can anyone see what might be wrong? :)
roadtrainCol.setCellValueFactory(
new Callback<CellDataFeatures<Spot,Boolean>,ObservableValue<Boolean>>()
{
public ObservableValue<Boolean> call(CellDataFeatures<Spot, Boolean> param) {
return param.getValue().getRoadtrain();
}
});
roadtrainCol.setCellFactory(col -> {
CheckBoxTableCell<Spot, Boolean> cell = new CheckBoxTableCell<>(index -> {
BooleanProperty active = new SimpleBooleanProperty();
active.addListener((obs, wasActive, isNowActive) -> {
System.out.println("del");
rettedeSpots(tableViewId.getItems().get(index).getId());
});
return active ;
});
return cell ;
});
Aucun commentaire:
Enregistrer un commentaire