title: Images won't load from jar file
body: <p>I have tried searching and still haven't got the solution. When I export to a jar file all my images suddenly do not work anymore. They run fine out of eclipse and I have made sure that they are in the jar file. I have tried using get resource methods and making a image-loader class to automatically go up the directory tree but it still fails. Here is what I have done:</p>
  
  <pre><code>public static Image load(String path)
  {   String temp = path;
      Image image = null;
      try {
  
       image = new ImageIcon(path).getImage();
  
  
      } 
  
      catch ( Exception e )
      {   
          try {
           while (image == null )
           {
                image = new ImageIcon("../"+ path).getImage();
           }
           if ( path.equals("../../../../../../"+ temp))
           {
               while ( image ==null)
               {
                   image = new ImageIcon("./"+ path).getImage();
               }
           }
          }
          catch ( Exception ae)
          {
  
  
          System.err.println("cannot locate image");
      }} 
  
  
      return image;
  }   
  </code></pre>
  
  <p>the path I will send it look as follows: "doc/icon.png" </p>
  
  <p>I have placed all my images in the doc folder, the structure is final Project, inside there is doc folder and then the src folder that contains all the packages.</p>