I made an application in which I had some images to be loaded for icons. The program runs fine with every thing working and images loading as expected , when I was loading the images using
imageOpen = Toolkit.getDefaultToolkit().getImage("Images\\open.png");
But when I exporter it as jar the Images didn't show up Then after looking here and there I tried some things but in both cases the URL is returning null
URL u = this.getClass().getResource("Images\\open.png");
imageOpen = Toolkit.getDefaultToolkit().createImage(u);
Another case
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
URL resource = classLoader.getResource("Images\\open.png");
imageOpen = Toolkit.getDefaultToolkit().createImage(resource);
Can any one tell me why am I getting null , I even tried "\Images\open.png" ,"/Images/open.png" and ".\Images\open.png" for the path I am using eclipse and the images are stored in the parent directory in a folder named Images and the source files are in src>master