java.lang.NullPointerException when setting icon?
<p>I've recently tried to set my default application icon with a .ico file I made myself. This is the code I used to create the icon:</p>

<pre><code>initComponents();
java.net.URL url = ClassLoader.getSystemResource("/src/calculatormedii/resources/CMedii.ico");
Toolkit kit = Toolkit.getDefaultToolkit();
Image img = kit.createImage(url);
getFrame().setIconImage(img);
</code></pre>

<p>I have no idea why it's so difficult to set the java desktop application icon in netbeans, it should just be a property field like the rest.
   When I try to run the program, these errors show up:</p>

<pre><code>    Uncaught error fetching image:
java.lang.NullPointerException
    at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:99)
    at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:113)
    at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:240)
    at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
    at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
</code></pre>

<p>No idea what to do now. If there is an alternate way to set the application icon please specify it (Like a property field in netbeans or something)</p>
