JavaFX: optimal width of TextFlow with word-wrap
问题 With Textflow.setMaxWidth(double) I can achieve text wrapping. But how can I adjust the width of TextFlow afterwards so that it is based on the actual wrapping position? In other words, how to let the TextFlow bounds snap to all of its children Text bounds to get rid of the empty space on the right: **Edit** I have made some progress on this issue. My class derived from TextFlow now contains: double maxChildWidth = 0; for (Node child : getManagedChildren()) { double childWidth = child