file - Java handling Resources in a Jar AND in the eclipse project -


im confused after reading many different information problem. im writing java game. of course have resources pictures sounds , on. need way, files in jar - when exported project - runs eclipse project. how scanning folder until now:

f = new file(this.getclass().getresource("../" + soundarchive).tostring().substring(5)).listfiles(); 

this confusing, unproffessional, , seems dont work in jar...

        inputstream = getclass().getclassloader().getresourceasstream("bgmusic.wav"); 

..is returning null in eclipse project...

so best way this?

thank you.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -