title: JavaFx : how to set image path situated in an other package
body: <p>i have in my javafx project 2 packages, the first "images" is didicated to images and the second for java code ,  I want to ask you how can i set image path in this case i tried serval solution but nothing worked.</p>
  
  <p><strong>Tried code :</strong></p>
  
  <pre><code>reg_image_statut.setImage(new Image("src/images/denided.png"));
  
  reg_image_statut.setImage(new Image("/src/images/denided.png"));
  
  reg_image_statut.setImage(new Image("/images/denided.png"));
  
  reg_image_statut.setImage(new Image("../images/denided.png"));
  </code></pre>
  
  <p><strong>Exception getted  :</strong></p>
  
  <pre><code>Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: Invalid URL: Invalid URL or resource not found
      at javafx.scene.image.Image.validateUrl(Image.java:1089)
      at javafx.scene.image.Image.&lt;init&gt;(Image.java:598)
  </code></pre>
  
  <p><strong>Solution:</strong>
  Yes @mipa the solution was very simple, it's exactly like you said,  the right solution was the only possiblity that i forgoted to try. Thankyou  @mipa</p>
  
  <pre><code>reg_image_statut.setImage(new Image("images/actived.png")); 
  </code></pre>