static block setDefaultPlatformUserAgentStylesheet() in PlatformImpl causes IllegalStateException

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P3
    • None
    • Affects Version/s: 8
    • Component/s: javafx
    • None

      I have a class that extends javafx.scene.control.Control. In the Control class there's a static block that calls another static block in PlatformImpl that causes an IllegalStateException.

      Because it's a static block it will always (you never know exactly when actually) be executed before the toolkit can be started. This makes it impossible to run any javafx application.

      Tested on 8b113 & 8b106

      Caused by: java.lang.IllegalStateException: Toolkit not initialized
      at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:272)
      at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:267)
      at com.sun.javafx.application.PlatformImpl.setPlatformUserAgentStylesheet(PlatformImpl.java:609)
      at com.sun.javafx.application.PlatformImpl.setDefaultPlatformUserAgentStylesheet(PlatformImpl.java:571)
      at javafx.scene.control.Control.<clinit>(Control.java:81)
      ... 26 more

            Assignee:
            Jonathan Giles
            Reporter:
            Erik De Rijcke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: