title: Issue loading style sheet in JavaFX
body: <p>I am developing an application on Linux using OpenJDK 8u20 and OpenJFX 8u5. I am basically trying to set a default style sheet for all scenes. There apparently isn't a a sanctioned way to do that, so the work around is to set the style sheet for each individual scene. The way to do this is "scene.getStylesheets().add(css)" where css is a String representing the location of the style sheet. That representation can be in three flavors: file, URL, or resource. </p>
  
  <p>An example of the URL approach is:</p>
  
  <pre><code>String css = "http://localhost/file.css";
  </code></pre>
  
  <p>An example of the file approach is:</p>
  
  <pre><code>String css = "file://" + new File("file.css").getAbsolutePath().replace("\\", "/");
  </code></pre>
  
  <p>An example of the resource is:</p>
  
  <pre><code>String css = this.getClass().getResource("file.css").toString();
  </code></pre>
  
  <p>Of the three, only the URL approach appears to work as advertised. </p>
  
  <p>The file approach appears to work initally, but subsequent compiles appears to break it. I can see that "scene.getStylesheets().add(css)" is being called with the correct value, but the application runs as if it never was. It only works after the compile that I edit the file that I am adding the stylesheet. If I edit any other file, compile, and run it does not work.</p>
  
  <p>The resource approach just throws a runtime exception, namely "sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)".</p>
  
  <p>I have a work around for now by using the URL approach, but long term I would really like to be able to package that CSS file in the jar and use it from the jar. Does anybody have any ideas or suggestions?</p>