I think it would be better to ListCell with a panel (e.g. StackPane) and a shortcut inside that would have an ellipsis function:
StackPane pane = new StackPane();
pane.setStyle("-fx-border-color:red;");
pane.setMinWidth(0);
pane.setPrefWidth(1);
pane.getChildren().add(label);
You can look at this link .
The same solution can be used for another ListCells complex.
source
share