java - JAR file not running when adding images -


i having problems exporting pictures jar file , after browsing found sollution, doesn't seem working

try {         //leftfoot = imageio.read(new file("resources/leftfoot.png"));         //rightfoot = imageio.read(new file("resources/rightfoot.png"));         url url = this.getclass().getresource("/resources/leftfoot.png");             leftfoot = imageio.read(url);             url = this.getclass().getresource("/resources/rightfoot.png");             rightfoot = imageio.read(url);         } catch (ioexception e) {         e.printstacktrace();     }      } 

so, if try upload items first 2 lines(and comment following 4), main gui stuff runs in jar file images ar not shown. if other way round(the code above), no gui element works in jar file. have "resources" folder containing pictures both in "bin" folder , in main folder along bin,src,settings etc. cause read somewhere how supposed be, although not know why. leftfoot , rightfoot bufferedimage objects. tell me not working here?


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -