First, you provided a relative path, so the system looks for an image relative to the location you performed.
Secondly, the path must have a disk specification, or at least a leading / . Depending on your setup, something like "C: /Users/Evan/javaItems/Sprites_and_Other_Art/green.png" should work (you may need to change the disk specification to suit your system)
Thirdly, make sure that the file exists at the specified location, System.out.println(new File("C:/Users/Evan/javaItems/Sprites_and_Other_Art/green.png").exists()) should return true , another wise file is in the wrong place.
Relative path basically means the location of the path relative to program execution. So, if you ran the program from C:/Program Files/MyAwesomeApplication , for example, the relative path Users/Evan/javaItems/Sprites_and_Other_Art/green.png became the absolute path C:/Program Files/MyAwesomeApplication/Users/Evan/javaItems/Sprites_and_Other_Art/green.png . This describes the path from the root directory to the corresponding file / folder.
You can verify this using System.out.println(new File("C:/Users/Evan/javaItems/Sprites_and_Other_Art/green.png").getAbsolutePath(ββ)) , which will give you the full path.
source share