As you can see I have tried various ways of loading images to my program,
Image iiii = new ImageIcon("src/gra/grafika/ramka.png").getImage(); //Image iiii = new ImageIcon(this.getClass().getResource("grafika/ramka.png")).getImage(); //Image iiii = new ImageIcon(ClassLoader.getSystemResource("gra/grafika/ramka.png")).getImage(); this.setIconImage(iiii);
(I keep every image loaded by the same method so i can easily change the way of doing this.)
The point is when i run it in eclipse there there is everything fine, but after making jar i get NullPointerException in line containing " Image iiii = ..." or just no single image appears (no nullpointerexception)
Question is HOW should i load them because I am a little bit resigned after wasting like 12h (pathetic) of testing ways, changing adresses without any success : |