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

static block setDefaultPlatformUserAgentStylesheet() in PlatformImpl causes IllegalStateException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8
    • 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

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

              Created:
              Updated:
              Resolved:
              Imported: