get size after CSS

Tom Eugelink tbee at tbee.org
Sat Dec 22 11:15:21 PST 2012


I've got a javafx.scene.txt.Text node with a content that can be a longer multi line (because of the wrapping width) text. But the node serves as the title of a special type of appointment in the agenda control, and I want it to only show the text that fits on the first single line. For this I'm trying to use Text's clipping feature with a rectangle of height "M". My problem is that the font being used is set in CSS.

How can I find out the Text's font height?

I tried using a 'new Text("M")' and then use boundsInParent, but the CSS is applied after the next pulse, so the value of "getBoundsInParent().getHeight()" initially is that of the default font. I also tried listening to boundsInParentProperty and update the height when it gets invalidated, but that does not seem to be triggered.

Tom


More information about the openjfx-dev mailing list