Well... just print out the url and check if it makes sense.
Let's say you have this lines of code:
keyboardImagePath = (new Object()).getClass().getResource("/gfx/keyboard.gif");
And the jar itself is in "C:\dls\java\q3tools\scancode" and the jar is called "KeyMatrix.jar".
The output is then:
And that works perfectly. The jar is really there and the file "keyboard.gif" is really inside the jar inside a sub directory called "gfx".
So just print the path and take a close look. It should start with "jar:file:/", then the full
path to the jar, then an exclamation mark and finally the relative path to the file you are looking for.