title: JavaFX Cannot Find Image
body: <p>just started a new project and am already running in to some issues. I am trying to display an image with javafx but the compiler is complaining that the provided location is invalid. Here is all of my code so far (apart from some imports):</p>
  
  <pre><code>public class main extends Application{
      public static void main(String[] args) {
          launch(args);
      }
  
      public void start(Stage primaryStage) throws Exception{
          Stage stage = primaryStage;
          String version = "alpha";
          stage.setTitle("Space Invaders v. " + version);
  
          VBox vbox = new VBox();
          Image pic = new Image("Art\\whiteMonster.jpg");
          ImageView image = new ImageView(pic);
          vbox.getChildren().add(image);
  
          Rectangle rect = new Rectangle(20,0,200,200);
          rect.setFill(Color.BLACK);
          vbox.getChildren().add(rect);
  
          //Creating the scene.
          Scene scene = new Scene(vbox);
          stage.setScene(scene);
          stage.show();
      }
  }
  </code></pre>
  
  <p>If I change the file path to the images url where I found it in google image search it displays the black rectangle added beneath it (just to test if everything works) but not the image. In the current configuration however it simply throws an error saying the URL is either invalid or that the resource was not found. What makes me think that this should work is this example here: <a href="https://docs.oracle.com/javase/8/javafx/api/javafx/scene/image/ImageView.html" rel="nofollow noreferrer">https://docs.oracle.com/javase/8/javafx/api/javafx/scene/image/ImageView.html</a></p>
  
  <p>Thanks for any help.</p>
  
  <p>PS. I've been looking at other similar questions here but haven't found anything that helped me and if you feel like you need any other information give me a shout.</p>
  
  <p>-----EDIT-----
  <a href="https://i.stack.imgur.com/Dnnil.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Dnnil.png" alt="Project Structure, Code and File Manager, all images are placed directly in the &quot;Art&quot; folder"></a>
  Project Structure, Code and File Manager, all images are placed directly in the "Art" folder.</p>
  
  <p>I hope that is all you need.</p>