title: Java Set Icon In class and get in Frame
body: <p>I have a project to hand in by tomorrow and been working all day to fix a problem.
  My icon for the Jframe is set but when i run netbeans to build JAR it is not able to get the Icon I have set. When just running it on netbeans it works fine. When running jar Image is not able to show.</p>
  
  <p>My code is as follows for Access Class:</p>
  
  <pre><code>public class LigacaoBD {
  public ImageIcon icone;
  protected BufferedImage imgicone;
  
  public LigacaoBD() {
      try {
          imgicone = ImageIO.read(new File("build/classes/Img/logo.png"));
          icone = new ImageIcon(imgicone);
  
  
      } catch (IOException ioe) {
          JOptionPane.showMessageDialog(null, "Erro no carregamento da imagem icone", jftitulo,
                  JOptionPane.WARNING_MESSAGE, icone);
      }
  }
  
  }
  </code></pre>
  
  <p>My code is as follows for the Jframe i want to set the icon for:</p>
  
  <pre><code>setIconImage(ligaDB.imgicone);
  </code></pre>
  
  <p>I am after it been able to load the icon when running the JAR.</p>
  
  <p>Thanks in advance.</p>