title: Trouble with jar file and image
body: <p>I have coded a program in Eclipse and it works properly when I run in that.  </p>
  
  <pre><code>public static void initialize() throws IOException{     
  
      JTextField tfQrText;
      int size = 250;
      File qrFile;
      BufferedImage qrBufferedImage;
  
      JFrame gui = new JFrame("qrCode Generator");
      gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      gui.setSize(250, 340);
      gui.setLayout(new BorderLayout());
      gui.setResizable(false);
  
  
      File iconFile = new File(VisualQrCodeGenerator.class.getResource("icon.png").getFile());    
      BufferedImage iconBuffered = ImageIO.read(iconFile);
      gui.setIconImage(iconBuffered);
  
      JButton generate = new JButton("Generate qrCode");
      gui.add(generate,BorderLayout.SOUTH);
  
      tfQrText = new JTextField();
      PromptSupport.setPrompt("Enter Your Text ... ", tfQrText);
      gui.add(tfQrText,BorderLayout.NORTH);
  
  
      qrFile = new File(VisualQrCodeGenerator.class.getResource("qrCodeImage.png").getFile());
      qrBufferedImage = ImageIO.read(qrFile);
      ImageIcon qrImageIcon = new ImageIcon(qrBufferedImage);
  
      JLabel image = new JLabel();
      image.setIcon(qrImageIcon);
  
      image.setHorizontalAlignment(JLabel.CENTER);
  
      gui.add(image,BorderLayout.CENTER);
  
      gui.setVisible(true);
      generate.addActionListener(new ActionListener() {
  
          @Override
          public void actionPerformed(ActionEvent arg0) {
              if(!(tfQrText.getText().equals(""))){
                  //create() Method make the QRcode Image
                  create();
              }               
          }
      });
  </code></pre>
  
  <p>The Error occurs on line:</p>
  
  <pre><code>BufferedImage iconBuffered = ImageIO.read(iconFile);
  </code></pre>
  
  <p>When I make it <code>.jar</code> file, it says:
  <a href="https://i.stack.imgur.com/HhpW5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HhpW5.png" alt="Opening file with windows CMD to know why it won&#39;t open"></a></p>
  
  <p>My Project structure is like this:</p>
  
  <pre><code>+src
  +qrCodeGenerator
    -VisualQrCodeGenerator
    -icon.png
    -qrCodeImage.png
  </code></pre>
  
  <p>The code is running properly and without any error in program and I can work with it. But when I make it .jar file, it errors me as I uploaded it image.</p>