Image and "painted component" dissapears when exporting to executable JAR file FIXED
<p>My problem is that when I run my program in Eclipse it works completely fine. Everything works as it should but when I export it as an and try to run the file it doesn't. From the beginning I imported an image this way:</p>

<pre><code>try {
    image = ImageIO.read(new File("src\\graphics\\raceTrack3.PNG"));
} catch (IOException e) {
        System.out.println("MAP NOT FOUND.");
        e.printStackTrace();
    }
//@Overide
public void paintComponent(Graphics g){
    super.paintComponent(g);
    g.drawImage(image, 0, 0, this);
    //....drew more stuff using g.draw...
</code></pre>

<p>When I tried to run this as a JAR-file it painted everything but the image, the "logic" also worked perfectly. So I searched around and everywhere I looked people said do it this way instead:</p>

<pre><code>try {
    image = ImageIO.read(getClass().getResource("/images/raceTrack3.PNG"));
} catch (IOException e) {
        System.out.println("MAP NOT FOUND.");
        e.printStackTrace();
    }
</code></pre>

<p>(Yes, I have created a new source Folder for the project and in that source folder I have a folder called images).</p>

<p>So I did this and everything still workes fine when I run it from Eclipse. However, when I export this and try to run the JAR-file now nothing shows up. It opens a window but nothing painted inside it. Just a tiny tiny window with the minimize, maximize and close buttons. Does anyone have a clue about what I am doing wrong? I can upload code but I don't really know what parts are of interest...</p>

<p>I solved it by replacing .PNG with .png
Gj me..</p>