I have added an image for my button,but when I run that frame this exception will be thrown .why?please help me.
init:
deps-jar:
compile-single:
run-single:
In order to fix this, the images need to be copied in the bin directory - not in src directory.
Otherwise you will get null all the time on getClass().getResource("image.png"). The path is not null and you can set it as the above - only if you copy the images that you need inside the binary directory, where .class files for your project are located.
This fixed the problem. Let me know if I helped in this.
Ioana