title: Error loading fxml file in a JavaFX project
body: <p>I have been working on a desktop application, where I need to use JavaFX. I have created an <code>fxml</code> file in a JavaFX project on eclipse. I build the scene in scene builder.when I am trying to run the main Java file, the changes which are made using scene builder on the <code>fxml</code> file are not getting reflected on the main window.and the screen is displayed blank. here is my code.</p>
  
  <pre><code>public class Main extends Application {
  @Override
  public void start(Stage primaryStage) {
      try {
          AnchorPane  root = new AnchorPane();
  
          Scene scene = new Scene(root,400,400,Color.BLACK);
          scene.getStylesheets().add(getClass().getResource("/application/sample.fxml").getPath());
          primaryStage.setTitle("FXML Welcome");
  
          primaryStage.setScene(scene);
          primaryStage.show();
      } catch(Exception e) {
          e.printStackTrace();
      }
  }
  
  public static void main(String[] args) {
      launch(args);
  }
  </code></pre>
  
  <p>And this is my <code>sample.fxml</code> file code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;?import java.lang.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  &lt;?import javafx.scene.layout.AnchorPane?&gt;
  &lt;?scenebuilder-background-color 0x00ffa3ff?&gt;
  
  &lt;AnchorPane prefHeight="379.0" prefWidth="549.0001220703125" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2"&gt;
  
  &lt;children&gt;
  &lt;Button layoutX="219.0" layoutY="156.0" mnemonicParsing="false" text="hello" /&gt;
  &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>
  
  <p>The error I got was:</p>
  
  <pre><code>     WARNING: com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged Resource "/F:/eclipse_progs/examplefx/bin/application/sample.fxml" not found.
  </code></pre>
  
  <p>But the location in the error specified contains the file it is referring to. Can anyone explain what might be the reason with the error. Is it with the code or is with the issues of plugin?</p>