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
Post a Comment