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

QuantumToolKit isSupported throws NullPointerException if Application.setUserAgentStylesheet called before Application.launch

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 8
    • javafx
    • None

      public class Main extends Application {

          public static void main(String[] args) {
              Application.setUserAgentStylesheet(STYLESHEET_MODENA);
              Application.launch(Main.class, args);
          }
      ...

      If you move the call to setUserAgentStylesheet to the start(Stage) method, everything is fine.

      Using Modena Theme
      Exception in thread "main" java.lang.NullPointerException
      at com.sun.javafx.tk.quantum.QuantumToolkit.isSupported(QuantumToolkit.java:1208)
      at com.sun.javafx.application.PlatformImpl.isSupported(PlatformImpl.java:447)
      at com.sun.javafx.application.PlatformImpl$11.run(PlatformImpl.java:543)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl.setPlatformUserAgentStylesheet(PlatformImpl.java:539)
      at javafx.application.Application.setUserAgentStylesheet(Application.java:434)
      at fxtest.Main.main(Main.java:40)

            kcr Kevin Rushforth
            dgrieve David Grieve
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: