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

JFXPanel: race condition when setting scene

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 7u10
    • javafx
    • Win64 JRE7u10

      As discussed on the mailing list in thread "JFXPanel ignores size change of root node" the following is a workaround to force a JFXPanel to resize itself when the scene's size has changed:

                Scene scene = getScene();
                setScene(null);
                setScene(scene);
                invalidate();

      In the attached testcase this seems to work for about 70-90% of all attempts. Adding a sleep between setScene(scene) and invalidate makes it 100%. On my core i5 with 2.6 Ghz the 10ms sleep is enough while 9ms is not. YMMV.

            Unassigned Unassigned
            wlehmann Werner Lehmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Imported: