How do I get text to wrap to the width of the cont...
# tornadofx
t
How do I get text to wrap to the width of the container? I have an HBox that centers a VBox, and the VBox is nicely elastic: It's the full width of the window when the window is small, but expands wider (to a limit) as the window is enlarged. But if I stick a Text with a paragraph of text into that VBox, it overflows and just keeps on going, off-screen, as a single line. I can set a wrapping width, but that ignores the size of the VBox container, which ruins the elastic UI.
On the other hand, if I use a Label and set isWrapText=true, the text properly wraps at the container boundaries... but only the first line of text shows up unless I force the container to be taller!
I just want something that behaves the way text flows in a block element in HTML...
...of course, now that I've said "the way text flows" I remember seeing TextFlow, and that seems to actually be what I wanted. :-)
👍 1