java - Accessing a png from inside a JAR -


currently have compiled jar file follows:

runme.jar   -guifile.class   -main.class   -notify.class   -resources   --sprites   ---myimg.png   -com   --random   ---package   ----makenotify.class   

please explain me how access png myimg.png inside makenotify.java

thanks advice in advance.

this depends, generally, want use class#getresource or class#getresourceasstream depending on how want read it.

something like...

 bufferedimage img = imageio.read(getclass().getresource("/resources/sprites/myimg.png")); 

for example...


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -