I wanted to test having a program with a simple png image on it. I wrote a short program that does this, but I can\'t seem to get the path right. I have checked, checked aga
The getResource(String) method will only find resources that are on the run-time class-path of the application. Since this image seems like an application resource (i.e. supplied by you as part of the application) it should be put on the run-time class-path.
E.G. Most IDEs have a place you can put resources within the project structure, that will automatically be included at run-time. Move (or copy) the image to that path.
Then it becomes a matter of providing the correct String. Let us imagine your project is set up something like this:
So Application.java is in package com.our;, while the image is in the path resources/green.png.
If accessing the image from the Application, the correct path would be (drum roll please..)
"/resources/green.png"
/ is important. It tells the JRE we want to look for the image from the 'root of the class-path', as opposed to using a path relative to the package of the class itself."/resources/green.png" will not locate an image named "/resources/Green.png" or "/resources/green.PNG".src directory, select Properties at the bottom of the menu. 
Location.

bin directory that contains classes and (hopefully) the image.