This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Originally posted by Jeffry Kristianto Yanuar: URL imageURL = sourceClass.getClass().getResource(path);
Since sourceClass is already a Class object, sourceClass.getClass will return Class.class. Just remove the getClass() call.
Where should I put the image files in JAR file assuming all my images is in the directory named images?
If the images directory is put in the root of the JAR file, you can access them by using "/images/myimage.gif" for the path. If the images directory is in the same folder as the class file, just remove the leading /