RFR: 8377153: JavaFX FlowPane layout causing improper wrapping of TextFlow nodes with max-width styling
Alessadro Parisi
duke at openjdk.org
Wed Feb 25 11:28:52 UTC 2026
On Tue, 24 Feb 2026 14:31:31 GMT, Alessadro Parisi <duke at openjdk.org> wrote:
>> This fixes the regression in FlowPane introduced with JDK-8350149 -- the calls have been adjusted in such a way that they follow the pre-25 JavaFX behavior.
>
> Hey, I'm not sure if my issue is related in some way to this, but text wrapping behavior seems to have changed from JavaFX 24 to 25.
> I have this:
>
> var bottom = new Label(description);
> bottom.getStyleClass().add("description");
> var vbox = new VBox(top, bottom);
>
> And this piece of CSS:
>
> .description {
> -fx-padding: 0.5em 0 0 0;
> -fx-font-size: 1.083333em;
> -fx-wrap-text: true;
> }
>
>
> After updating to JavaFX 25 the text is truncated. Before it would take as much height as needed to show all the text.
>
> Sorry if this is OT, I tried searching for any commit that may have caused this but could not find anything.
> The closest thing I found was 7699c44 by @andy-goryachev-oracle but it is also included in v23 and v24. This behavior I'm observing is present only in v25
>
> Edit: forgot to mention that by doing `bottom.setMinHeight(Region.USE_PREF_SIZE);` the old behavior is back and the text is wrapped.
> @palexdev That's correct, it's probably related to the regression you can find in the ticket linked to this PR: https://bugs.openjdk.org/browse/JDK-8377153
>
> Once this fix is in, this won't be needed.
@hjohn Thanks a lot for the clarification! From my understanding this specific PR will fix the FlowPane layout algorithm, but not my case (VBox), so I presume you will follow up with a separate PR, did I get it right?
-------------
PR Comment: https://git.openjdk.org/jfx/pull/2077#issuecomment-3957460005
More information about the openjfx-dev
mailing list