A starter in javafx, I need some help. I followed the example here and got the cell edit working perfectly. I enabled the cell selection of the TableViewsetCellSelectionEnabled true in TableViewSelectionModel. But when I finish editing the cell, the TableView loses focus and the focus goes to the first node in the scene. I tried getting the currently selected cell and use focus() of getFocusModel() even in a Platform.runLater but no result.
A workaround could be to request the focus on the setEditOnCommit:
firstNameCol.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<Person, String>>() {
@Override
public void handle(TableColumn.CellEditEvent<Person, String> event) {
table.requestFocus();
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With