My build folder of project has following structure:
build
|-classes
|package
|-HelloWorld.class
|-resources
|-images
|-image.png
There is ImageIcon object in HelloWorld class and its declaration should look like this:
ImageIcon icon = new ImageIcon(HelloWorld.class.getResource("../../resources/images/picture.png"));
But it throws NullPointerException
in getResource()
method. Where did I make a mistake?