title: JavaFX Image not showing in stage
body: <p>I've tried several times and several ways but I can't make my image show on stage as I want. I think it might has to do with the path where java looks for resources, but i'm not sure, since I'm just starting using visual libraries (JavaFX in this case). Here's my directory structure:</p>
  
  <pre><code>MyProject
   |_assets
   |  |_img
   |     |_myImage.jpg
   |
   |_some
   |_other
   |_folders
   |
   |_src
      |_ve
         |_org
            |_project
               |_MyProject.java
               |_StratPage.fxml
               |_StartPageController.java
  </code></pre>
  
  <p>I need to retreive <code>myImage.jpg</code> to be rendered, and I've tried the following:</p>
  
  <p>1) Pure fxml approach:</p>
  
  <blockquote>
  <pre><code>&lt;ImageView
       id="logo" 
       fx:id="logo"
       fitHeight="99.0" 
       fitWidth="99.0" 
       layoutX="14.0" 
       layoutY="18.0" 
       pickOnBounds="true" 
       preserveRatio="true"&gt;
           &lt;image&gt;
              &lt;Image url="@../../../../assets/img/myImage.jpg" /&gt;
           &lt;/image&gt;
  &lt;/ImageView&gt;
  </code></pre>
  </blockquote>
  
  <p>2) Using both fxml and java. Declaring the <code>ImageView</code> element with <code>fx:id="logo"</code>, and injecting the image from <code>StartPageController.java</code> like this:</p>
  
  <pre><code>public class StartPageController implements Initializable {
  
      @FXML
      private ImageView logo;
  
  
      @Override
      public void initialize(URL url, ResourceBundle rb) {
          this.logo = new ImageView("file:../../../../assets/img/myImage.jpg");
      }    
  
  }
  </code></pre>
  
  <p>Neither way produce any exception, i just does not show the image. I have no idea what to do. I would really appreciate your help.</p>
  
  <h1>UPDATES:</h1>
  
  <h2>First</h2>
  
  <p>I tried giving up on having the proposed directory structure, and placed the image file in the same folder of <code>StartPageController.java</code>. By doing </p>
  
  <pre><code>logo = new ImageView(new Image(getClass().getResourceAsStream("myImage.jpg")))
  </code></pre>
  
  <p>I'm not getting any exception, but the image is not rendering, which suggest me it's not about finding the resource, but about rendering the image. Could it be the lack of any library? I'm on a Windows 8 environment, using Netbeans 8.0. Thanks again for your answers.</p>
  
  <h2>Second</h2>
  
  <p>I just deactivated packaging and distributing the app in the project properties in Netbeans. Now the images are rendering correctly, but I don't consider the issue solved, since when I need to distribute the software it will re emerge. Please, help is still needed! :)</p>