java - Cannot create relative path -


my build folder of project has following structure:

build   |-classes         |package              |-helloworld.class   |-resources         |-images               |-image.png 

there imageicon object in helloworld class , declaration should this:

imageicon icon = new imageicon(helloworld.class.getresource("../../resources/images/picture.png")); 

but throws nullpointerexception in getresource() method. did make mistake?


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -