This is question about javaFX8.
I have listView and custom cellFactory.
every cell is :
it is:
1.AnchorPane
1.1.Circle
1.1.AnchorPane
1.1.1.Label
1.1.2.Label
1.1.3.TextFlow
But if text in TextFlow is large, I see this image
So in updateItem menthod I do this
Text text = new Text();
text.textProperty().setValue(data.getMessage());
....
messageTextFlow.getChildren().addAll(text);
....
double height = (messageTextFlow.getChildren().get(0)).getLayoutBounds().getHeight() + 28;
anchorPane.setPrefHeight(height);
But it doesn't work the first time. The correct height of the cell exposed only once again I will update this listview.
How can I solve this problem? Is there are any method to connect TextFlow height with ListCell height?
Thank you!