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

CSS Stylesheet not found when starting via Java Web Start

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • fx2.1
    • fx2.0
    • javafx
    • Windows 7 64bit, JRE/JDK 1.6.0_26, JavaFX 2.0 beta SDK 28. Jun, Eclipse 3.7 IDE, Maven 3.0.3

      When running my mavenized JavaFX application directly drom eclipse IDE my stylesheet is loaded correctly:

      mystage.getScene().getStylesheets().add("/css/main.css");

      My folder structur:
       + src/main/java
          - /myapp/Main.java
       + src/main/resources
          - /css/main.css

      But after packaging my project via maven to .jar and .jnlp and running it, the stylesheet is not loaded anymore.
      Console:
      WARNING: com.sun.javafx.css.StyleManager$2 run Resource "null" not found.

      The jar folder structure:
       + myapp/Main.class
       + css/main.css

      But if I put the main.css to C:\ and then use .add("file:/c:/main.css"); it works fine.

      Seem to be a path resolution problem in the StyleManager.

            dgrieve David Grieve
            aliebelt Andreas Liebelt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: