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.
Javafx TableView goes out of focus after cell edit
I have the same problem. Anyone found a solution? –
Conde
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();
}
});
© 2022 - 2024 — McMap. All rights reserved.