I created a tableview with a feature that automatically wraps text to the next line when Enter is pressed and changes the state of the next row to edit mode using the following code:
Java
this.rowSelect = lastIndex;
if (this.rowSelect < list.size()) {
tableData.getSelectionModel().select(this.rowSelect + 1);
tableData.edit(this.rowSelect, columnDiem);
}
tableData.setOnKeyTyped(event -> {
TablePosition<List<StringProperty>, String> focusedCell = tableData.getFocusModel().getFocusedCell();
if (focusedCell != null) {
tableData.getFocusModel().focus(focusedCell.getRow() + 1, columnDiem);
tableData.edit(focusedCell.getRow(), columnDiem);
}
});
When I debug the application, it runs perfectly fine. However, after building the JAR file, the display on the tableview starts to have problems. The selected row and the displayed edit cell start to misalign. I noticed that this error only occurs if the tableview has large row sizes that require scrolling.
I am using IntelliJ IDEA 2024.1, jdk 22.0.1, javafx 14, and jre 8u411 to run the JAR file.
I’m trying find what happen, I don’t know why.