title: How to set the correct path for an ImageIcon?
body: <p>I really will appreciate some help here:</p>
  
  <p><strong>My current scenario</strong>: I've been facing an error each time I try to load: 
  <em>jPanel</em>, <em>jFrame</em>, <em>jInternalFrame</em> or <em>any other java component (java.swing.<strong>component</strong>)</em> . If I load my panel with an ImageIcon set like this ones (<em>described below</em>) I get a nullpointerexeption because it's not found the image wiith the image's path provided in the String.</p>
  
  <p>Note: My IDE is Oracle's JDeveloper 11G.</p>
  
  <hr>
  
  <p>private ImageIcon image1 = new ImageIcon(getClass().getResource(<strong><em>path</em></strong>));</p>
  
  <p>format 1:</p>
  
  <blockquote>
    <p><strong>"..\\src\\Image\\add.png"</strong> , <strong>".\\src\\Image\\add.png"</strong> ,<strong>"\\src\\Image\\add.png"</strong></p>
  </blockquote>
  
  <p>(I realized this:[<strong>"..\\src\\Image\\add.png"</strong>] works to almost everyone in my college, if I run any project that was not developed by myself it works fine otherwise it fails.)</p>
  
  <p>format 2:</p>
  
  <blockquote>
    <p><strong>"..\\Image\\add.png"</strong>, <strong>".\\Image\\add.png"</strong>, <strong>"\\Image\\add.png"</strong></p>
  </blockquote>
  
  <p>format 3:</p>
  
  <blockquote>
    <p><strong>"..\\add.png"</strong>, <strong>".\\add.png"</strong>, <strong>"\\add.png"</strong></p>
  </blockquote>
  
  <p>format 4:</p>
  
  <blockquote>
    <p><strong>"../src/Image/add.png"</strong> , <strong>"./src/Image/add.png"</strong> ,<strong>"/src/Image/add.png"</strong></p>
  </blockquote>
  
  <p>format 5:</p>
  
  <blockquote>
    <p><strong>"../Image/add.png"</strong> , <strong>"./Image/add.png"</strong> ,<strong>"/Image/add.png"</strong></p>
  </blockquote>
  
  <p>format 6:</p>
  
  <blockquote>
    <p><strong>"../add.png"</strong> , <strong>"./add.png"</strong> ,<strong>"/add.png"</strong></p>
  </blockquote>
  
  <hr>
  
  <p>Thanks in advance for any help</p>