Set CheckBoxTableCell in FXML
Unfortunately CheckBoxTableCell
is not a factory, and there is none available in the JavaFX package. You have to write your own factory.
public class CheckBoxTableCellFactory<S, T> implements Callback<TableColumn<S, T>, TableCell<S, T>> {
public TableCell<S, T> call(TableColumn<S, T> param) {
return new CheckBoxTableCell<S,T>();
}
}
Then you can define your table column in the FXML file as:
<TableColumn text="Some Col">
<cellValueFactory><PropertyValueFactory property="property" /> </cellValueFactory>
<cellFactory><CheckBoxTableCellFactory /></cellFactory>
</TableColumn>
Don´t forget to include the CheckBoxTableCellFactory
or else to declare the full path like org.my.CheckBoxTableCellFactory
or the loader will give you a not found exception.