title: Setting the default application icon image in Java swing on OS X
body: <p>I'm trying to set the icon image for a Jar file:</p>
  
  <pre><code>setIconImage(new ImageIcon(getClass().getResource("logo.png")).getImage());
  </code></pre>
  
  <p>When running in Mac OS X 10.7.4 I get the following error:</p>
  
  <pre><code>Jun 28 15:21:40 (my dhcp) java[73383] &lt;Error&gt;: CGContextGetCTM: invalid context 0x0
  Jun 28 15:21:40 (my dhcp) java[73383] &lt;Error&gt;: CGContextSetBaseCTM: invalid context 0x0
  Jun 28 15:21:40 (my dhcp) java[73383] &lt;Error&gt;: CGContextGetCTM: invalid context 0x0
  Jun 28 15:21:40 (my dhcp) java[73383] &lt;Error&gt;: CGContextSetBaseCTM: invalid context 0x0
  Jun 28 15:21:40 (my dhcp) java[73383] &lt;Error&gt;: CGContextGetCTM: invalid context 0x0
  Jun 28 15:21:40 (my dhcp) java[73383] &lt;Error&gt;: CGContextSetBaseCTM: invalid context 0x0
  </code></pre>