title: Setting an icon for a jFrame in Netbeans swing gui builder
body: <p>I've been trying to set up a window in Netbean's GUI builder, without success. I've tried accessing the JFrame, from my main class as:</p>
  
  <pre><code>public void run(){
  
      JFrame frame = new JFrame("Title of Frame");
      frame.setIconImage(Toolkit.getDefaultToolkit().getImage("org/icon.png"));
  
  }
  </code></pre>
  
  <p>Which creates a new frame apart from my main window with my icon.png. I'd like to know if there is some way to gain access to the JFrame that contains the rest of my UI elements, and set that icon.  </p>
  
  <p>I've also tried
  <code>new SearchAppUI().setIconImage(null);</code>
  which doesn't do anything of note.</p>
  
  <p>Setting the icon directly:</p>
  
  <pre><code>JFrame.setIconImage("org/icon.png"); 
  </code></pre>
  
  <p>gives me the error, <em>non-static method setIconImage(java.awt.Image) cannot be referenced from a static context.</em></p>
  
  <p>Is there any way to set the main JFrame's icon from either Netbean's swing desinger preview, or from my run() method? </p>