The following code will only work on my computer but not on others:
doll.setIcon(new ImageIcon("C:/Users/akashsharma/Documents/NetBeansProjects/Hangman/src/win/images/G.jpg"));
I have tried using the following but it results in a NullPointerException
.
getClass().getResource("/images/G.jpg")
What should I do to solve this problem?
The arrangement of files in the IDE