title: JavaFx Could not load @font-face font because of com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
body: <p>I had already asked a similar question <a href="https://stackoverflow.com/questions/33973921/javafx-font-face-css-error-loadstylesheetunprivileged">here</a> but it seems It wasn't clear since I had a lot of code in the project and couldn't post it here So <strong>please</strong> don't mark as duplicate. </p>
  
  <p>Because of that, I then decided to create a new project with just a <strong>Label</strong> in it to make the code small and clean and also to eliminate other <strong>potential suspects</strong> of the error I'm getting.</p>
  
  <p>So here is my <strong>Java Source code</strong></p>
  
  <pre><code>public class Main extends Application {
  
      @Override
      public void start(Stage primaryStage) throws Exception {
          Group root = new Group();
  
          Label label = new Label("Sample Label");
          label.setId("sampleLabel");
          root.getChildren().add(label);
  
          Scene scene = new Scene(root, 300, 275);
          scene.getStylesheets().add(getClass().getResource("applicationStyles.css").toExternalForm());
          primaryStage.setTitle("Hello World");
          primaryStage.setScene(scene);
          primaryStage.show();
      }
  
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>
  
  <p>And this is my <strong>css file</strong></p>
  
  <pre><code>/**/
  @font-face {
      font-family:'Roboto';
      src:url("Roboto-Thin.ttf");
  }
  #sampleLabel{
      -fx-font-family: Roboto ;
  }
  </code></pre>
  
  <p>This is the error I'm getting in Intellij Idea</p>
  
  <pre><code>Dec 02, 2015 9:16:34 AM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
  INFO: Could not load @font-face font [file:/C:/Users/UserName/Desktop/Java8%20projects/TeamViewer/out/production/TeamViewer/sample/Roboto-Thin.ttf]
  </code></pre>
  
  <blockquote>
    <p>All the project files are in one package and the font file is also present in the out>production>TeamViewer>sample>Roboto-Thin.ttf. I also upgraded from jdk-8u65 to jdk-8u66</p>
  </blockquote>
  
  <p>Thanks, any help is greatly appreciated.</p>