So I am trying to load a .png file for a very simple game. I have my all of my code saved in the directory: "C:\Users\Zach\Desktop\TestGame\source", and my image that I'm trying to load in a directory called "C:\Users\Zach\Desktop\TestGame\images". To load the image i am using
ImageIcon ii = new ImageIcon(this.getClass().getResource("..\\images\\right3.png"));
I used the ".." to move up one directory where the images directory is, and I am on a Windows machine so I was told to use the "\\" as a file separator character. However when I try to run the program I get a nullpointerexception. How could I fix this problem? Thanks in advance.