I am trying to load icons from a jar file. I have both tried to load it from classes within the jar file as well as classes outside the jar file.
outside of the
Skip the class loader, and get the resource as a stream instead. If you don't need the URL you can turn them directly into BufferedImages like so. I've left the stream and exception handling as a further exercise.
InputStream stream = LoadHTMLExample.class
.getResourceAsStream( "/icons/mouse.png" );
BufferedImage image = ImageIO.read( stream );
Questioner needs the URL which brings us back to everyone else's suggestions. The images are definitely in the jar aren't they?