This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Parameters: filename - a String specifying a filename or path
So it is looking for a file with the specified name. If you don't specify a directory (as you did), it will look for the file in the current directory. If you put your file inside a JAR, then it will not find the file.
Have a look at the API documentation for ImageIcon. It has another constructor that takes an URL. You could use that to load the image from a JAR file like this: