Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8116283

Need to way to force layout rendering before printing

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:

      Description

      Printing on non-FX thread means the layout may not be rendered correctly.
      The printing API doesn't recommend to use the FX thread but you don't have really the choice for now.

      My sample layout (see attached print-3.fxml) is made of 6 rectangles of size 200x200 each, positioned into a GridPane so that the grid size is 600x400. Border of the rectangles is red.
      In non FX thread the layout bounds value I get is 200x200, the content of one cell of the grid (!), hence a wrong computation of bounds for printing (and a non expected clipping). The rectangles are rendered black & white, the red color of the borders is lost, see attached print-3-non-fx-thread.pdf.
      In FX thread all's fine, see attached print-3-fx-thread.pdf.

        Attachments

        1. print-3.fxml
          2 kB
        2. print-3-fx-thread.pdf
          3 kB
        3. print-3-non-fx-thread.pdf
          6 kB
        4. selvia.fxml
          41 kB

          Issue Links

            Activity

              People

              • Assignee:
                prr Philip Race
                Reporter:
                yjoan Yves Joan (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: