title: How to add images to a ListView
body: <p>I've been reading documents for the last 8 hours and found nothing that could help me. Vaguely yes, but no code is working becuase it keeps saying "image url not found" and throws the exception. However I have other projects and never had this issue.</p>
  
  <p>So, there's one class that contains months like so:</p>
  
  <pre><code>public enum Month{JAN(1, "img.png",...DEC(12, "img.png");
  private final int monthValue;
  private final String imgName;
  
  private Month(int monthValue, String imgName){
  this.monthValue = monthValue;
  this.imgName = imgName;
  }
  
  public int getMonth(){
  return monthValue;
  }
  
  public String getImage(){
  return imgName;} 
  }
  </code></pre>
  
  <p>So far, so good. I can even test it in console and works fine and also sorts by value. Now when I try to add images from resources there's the problem I mentioned before: the url is not found. However, I can do a ImageView with only 1 value of the image, using the path goes from "C:\...\resources\monthImg.png" but I work with other person and eachtime I send it online he must change the image directory as well. Takes much time.</p>
  
  <p>Now, what I've been trying to do is to get 12 images and set them to this enum in the main project class. So I can then assign to nodes and work GUI.</p>
  
  <p>My approach was to follow this thread: <a href="https://stackoverflow.com/questions/33592308/javafx-how-to-put-imageview-inside-listview">JavaFx : How to put ImageView inside ListView</a> However, it uses <strong>setCellFactory</strong> which I am pretty sure you can do this without that method and less code lines.</p>
  
  <p>I have two packages called "main" (which contains the main class and the month class with its constructors and methods) and a resources package also called "main" in a different folder (which contains all images).
  Remember that it works if I use the whole full path from C:\ but I'd also like to have it started in the project itself to send it to my friend.</p>
  
  <p>What would be the approach look like so I can get these images with value stack with each other in descendant values inside a VBox like the example in the link above?</p>
  
  <p>Note: The project is to make those images look like a calendar stacked up with <em>drag and drop options</em> (which I know to do). Thanks.</p>