title: Images not showing on launch by the main, but showed on Scene builder
body: <p>I'm new on coding, especialy in java, and i've tryed to use JavaFx with scene builder.
  My issue today is that i've done that menu with scene builder:</p>
  
  <p><a href="https://imgur.com/a/IH0lf" rel="nofollow noreferrer">https://imgur.com/a/IH0lf</a></p>
  
  <p>And when I run it the images doesn't show. I've try with other scenes i've made, same issue.</p>
  
  <p><a href="https://imgur.com/a/UuCMi" rel="nofollow noreferrer">https://imgur.com/a/UuCMi</a></p>
  
  <p>Here is my Main : </p>
  
  <pre><code>package com.doki;
  
  import java.io.IOException;
  import javafx.application.Application;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Scene;
  import javafx.scene.layout.AnchorPane;
  import javafx.scene.layout.BorderPane;
  import javafx.stage.Stage;
  
  public class MainRpg extends Application {
  
      private Stage stage;
      private BorderPane fenetre;
  
      @Override
      public void start(Stage stage) {
          this.stage = stage;
          this.stage.setTitle("Xar'Saroth");
  
          initFenetre();
  
          showMenu();
      }
  
      /**
       * Initializes the root layout.
       */
      public void initFenetre() {
          try {
              // Load root layout from fxml file.
              FXMLLoader loader = new FXMLLoader();
              loader.setLocation(MainRpg.class.getResource("view/Fenetre.fxml"));
              fenetre = (BorderPane) loader.load();
  
              // Show the scene containing the root layout.
              Scene scene = new Scene(fenetre);
              stage.setScene(scene);
              stage.show();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  
      /**
       * Shows the person overview inside the root layout.
       */
      public void showMenu() {
          try {
              // Load person overview.
              FXMLLoader loader = new FXMLLoader();
              loader.setLocation(MainRpg.class.getResource("view/Menu.fxml"));
              AnchorPane personOverview = (AnchorPane) loader.load();
  
              // Set person overview into the center of root layout.
              fenetre.setCenter(personOverview);
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  
      /**
       * Returns the main stage.
       * @return
       */
      public Stage getStage() {
          return stage;
      }
  
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>
  
  <p>And my scene code : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import javafx.scene.control.Button?&gt;
  &lt;?import javafx.scene.control.ButtonBar?&gt;
  &lt;?import javafx.scene.image.Image?&gt;
  &lt;?import javafx.scene.image.ImageView?&gt;
  &lt;?import javafx.scene.layout.AnchorPane?&gt;
  
  &lt;AnchorPane prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1"&gt;
     &lt;children&gt;
        &lt;ImageView fitHeight="600.0" fitWidth="900.0" pickOnBounds="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"&gt;
           &lt;image&gt;
              &lt;Image url="@../menuImage.jpg" /&gt;
           &lt;/image&gt;
        &lt;/ImageView&gt;
        &lt;ImageView fitHeight="186.0" fitWidth="489.0" layoutX="206.0" layoutY="343.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="150.0"&gt;
           &lt;image&gt;
              &lt;Image url="@../xarSaroth.png" /&gt;
           &lt;/image&gt;
        &lt;/ImageView&gt;
        &lt;ButtonBar layoutX="295.0" layoutY="518.0" prefHeight="40.0" prefWidth="281.0" AnchorPane.bottomAnchor="50.0"&gt;
          &lt;buttons&gt;
            &lt;Button mnemonicParsing="false" prefHeight="25.0" text="Continuer" /&gt;
              &lt;Button mnemonicParsing="false" prefHeight="25.0" prefWidth="134.0" text="Nouvelle Partie" /&gt;
          &lt;/buttons&gt;
        &lt;/ButtonBar&gt;
     &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>
  
  <p>I've read thoses posts : </p>
  
  <p><a href="https://stackoverflow.com/questions/29550225/why-isnt-my-background-image-being-displayed-in-fxml">Why isn&#39;t my background image being displayed in FXML</a></p>
  
  <p><a href="https://stackoverflow.com/questions/21497741/images-imported-in-scene-builder-is-not-getting-displayed-while-executed-in-netb">Images imported in scene builder is not getting displayed while executed in netbeans</a></p>
  
  <p>But the solutions didn't work on me, or i'm just a bit too stupid.</p>
  
  <p>By the way i've gor this error message when I launch, I don't think that is the issue : 
  WARNING: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.121</p>
  
  <p>Thanks!</p>
  
  <p>EDIT : </p>
  
  <p>I have done this change : <code>((Image)loader.getNamespace().get("image1")).getException().printStackTrace(System.err);</code></p>
  
  <p>and it makes that kind of error. I understand that there is a path issue no?</p>
  
  <pre><code>    java.io.FileNotFoundException: C:\Users\Stagiaire ACI\Desktop\Java\XarSaroth\bin\com\doki\menuImage.jpg (Le fichier spécifié est introuvable)
  at java.io.FileInputStream.open0(Native Method)
  at java.io.FileInputStream.open(Unknown Source)
  at java.io.FileInputStream.&lt;init&gt;(Unknown Source)
  at java.io.FileInputStream.&lt;init&gt;(Unknown Source)
  at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
  at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
  at java.net.URL.openStream(Unknown Source)
  at com.sun.javafx.iio.common.ImageTools.createInputStream(ImageTools.java:486)
  at com.sun.javafx.iio.ImageStorage.loadAll(ImageStorage.java:311)
  at com.sun.javafx.tk.quantum.PrismImageLoader2.loadAll(PrismImageLoader2.java:127)
  at com.sun.javafx.tk.quantum.PrismImageLoader2.&lt;init&gt;(PrismImageLoader2.java:71)
  at com.sun.javafx.tk.quantum.QuantumToolkit.loadImage(QuantumToolkit.java:720)
  at javafx.scene.image.Image.loadImage(Image.java:1065)
  at javafx.scene.image.Image.initialize(Image.java:807)
  at javafx.scene.image.Image.&lt;init&gt;(Image.java:695)
  at com.sun.javafx.fxml.builder.JavaFXImageBuilder.build(JavaFXImageBuilder.java:47)
  at com.sun.javafx.fxml.builder.JavaFXImageBuilder.build(JavaFXImageBuilder.java:37)
  at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:763)
  at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2823)
  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2532)
  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
  at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
  at com.doki.MainRpg.showMenu(MainRpg.java:56)
  at com.doki.MainRpg.start(MainRpg.java:24)
  at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
  at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
  at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
  at java.security.AccessController.doPrivileged(Native Method)
  at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
  at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
  at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
  at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
  at java.lang.Thread.run(Unknown Source)
  </code></pre>