There are many tutorials and many suggestions for this, expanding JavaFX cells to make them editable. Good question about thread_stack .
But official tutorials use a method call to create a callback without writing all this code, calling
lastNameCol.setCellFactory(TextFieldTableCell.forTableColumn());
However, when I do this in my code (FormTokens is my "model"):
// At beginning of class declaration @FXML private TableColumn<FormTokens, String> valuColumn; // Later at initialization valuColumn.setCellFactory(TextFieldTableCell.forTableColumn());
The compiler says:
SetCellFactory method ( Callback<TableColumn<FormTokens,String>,TableCell<FormTokens,String>>)
in type TableColumn<FormTokens,String>
not applicable for arguments (Callback<TableColumn<Object,String>,TableCell<Object,String>>)
If I delete the method call mentioned above, everything works fine, except that the TableView cells are not editable. What am I doing wrong?
edit: I just found this: Javafx TableView cannot be edited But there are no solutions. How to make Callback<TableColumn<Object,... on Callback<TableColumn<FormTokens,... ?
javafx-2 tableview
loolooyyyy
source share