I'm trying to add a change listener to my CheckBoxTableCells but it doesn't seem to be working. I took the example for CheckBoxes figuring they would work the same way. However there is no output when i change its value. How would i add one correctly to a checkboxtablecell?
current code:
tc.setCellFactory(new Callback<TableColumn<Trainee, Boolean>, TableCell<Trainee, Boolean>>() {
@Override
public TableCell<Trainee, Boolean> call(TableColumn<Trainee, Boolean> p) {
final CheckBoxTableCell ctCell = new CheckBoxTableCell<>();
ctCell.selectedProperty().addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue ov, Boolean old_val, Boolean new_val) {
System.out.println(new_val);
}
});
return ctCell;
}
});