Re: Help with pictures

The createImageIcon method (as it is called in your code) looks for the image relative to the class that is calling it. If the class is in a package, then it looks for the Images folder within the package folder. But first things first, the getResource() method takes UNIX style path separators (see the API for more information), so presuming the class and Images directory are in the same directory, try 'Images/player.png'

Re: Help with pictures

Re: Help with pictures

Originally Posted by HelloWorld1234

will "C:/Users/ole/Desktop/player.png" then be a valid path for that method?

Again, I'll point you to the API. The path you pass to getResource() should be relative to either the root package folder (in which one precedes the path with a '/' to denote it is an absolute path relative to the root package) or the class that contains the method. As an example, suppose you have a class named MyClass, and in the same directory you have a folder named Images which contains a file named player.png, then you can call:
getClass().getResource("Images/player.png");