java - How can I access files in my SRC folder? -


hi ive been trying access image files within src folder can run directly jar. unfortunatly not loading them can please have help. null pointer exception , cannot read input file. here location of folder , put in code. code: "/sprites/mapsheet2.png" directory: c:\users\lucas\workspace\vigilante\src\sprites\mapsheet2.png if info needed tell me , ill send it.

resources .jar file can loaded with: getclass().getresource() returns url correct path

image icon = imageio.read(getclass().getresource("image´s path")); 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -