JavaFX FlowPane layout causing improper wrapping of TextFlow nodes with max-width styling

XMLWordPrintable

    • b01
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      -

      A DESCRIPTION OF THE PROBLEM :
      JDK-8350149 introduced some regressions in other panes. Some panes have been checked and fixed since, but flowpane still has issues. (possibly other panes too, but I will leave it with flowpane for this report)

      REGRESSION : Last worked in version 24.0.2

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See source code example.

      ---------- BEGIN SOURCE ----------
      package bug.java.flowpanebug;

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.layout.FlowPane;
      import javafx.scene.text.Text;
      import javafx.scene.text.TextFlow;
      import javafx.stage.Stage;

      public class BugApplication extends Application {
          @Override
          public void start(Stage stage) {
              FlowPane flowPane = new FlowPane();
              TextFlow tf1 = createTextFlow();
              TextFlow tf2 = createTextFlow();
              TextFlow tf3 = createTextFlow();
              flowPane.getChildren().addAll(tf1, tf2, tf3);
              Scene scene = new Scene(flowPane, 320, 240);;
              stage.setScene(scene);
              stage.show();
          }

          private static TextFlow createTextFlow() {
              TextFlow textFlow = new TextFlow(new Text("this is a long text that will be wrapped"), new Text("this is a long text that will be wrapped"), new Text("this is a long text that will be wrapped"));
              textFlow.setStyle("-fx-background-color: red; -fx-max-width: 10em; -fx-wrap-text: true");
              return textFlow;
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Stay on 24.0.2

      FREQUENCY :
      ALWAYS

        1. BugApplication.java
          1 kB
          Praveen Narayanaswamy
        2. FAIL_Screenshot.png
          6 kB
          Praveen Narayanaswamy
        3. PASS_Screenshot.png
          12 kB
          Praveen Narayanaswamy

            Assignee:
            John Hendrikx
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: