title: ImagePanel isn't showing in my jar file with netbeans
body: <p>i used a class Imagepanel  to show a background image to my panel in  netbeans  .It successfully works when running it from the IDE netbeans 6.8 ,but when i run it from the jar file it doesn't show the image .Please help me to solve this problem .Thanks for your remarks .
  Here is my code ImagePanel.java</p>
  
  <pre><code>  import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Image;
    import javax.swing.ImageIcon;
    import javax.swing.JPanel;
  
  
  
   class ImagePanel extends JPanel {
  
     private Image img;
  
     public ImagePanel(String img ) {
  
  
        this(new ImageIcon(img).getImage());
  
  
  }
  
     public ImagePanel(Image img) {
       this.img = img;
       Dimension size = new Dimension(img.getWidth(null), img.getHeight(null));
       setPreferredSize(this.getMaximumSize());
       setMinimumSize(size);
       setMaximumSize(size);
       setSize(this.getMaximumSize());
       setLayout(null);
     }
  
     @Override
      public void paintComponent(Graphics g) {
         g.drawImage(img, 0, 0, null);
       }
  
   }
  </code></pre>
  
  <p>I have created my panel which is in another class like this where my image is in the directory images under src. Thanks in advance .</p>
  
  <pre><code>ImagePanel pan2 = new ImagePanel("src/images/tarif.png");
  </code></pre>