I am having real trouble referencing a simple image in a jar file.
I have a package au.com.mysite.pdf
tha contains the java files
I have a package au.com.mysite.pdf.res
tha contains images
In my java file I reference an image like this
getClass().getResource("/au/com/mysite/pdf/res/logo.png").getPath()
but the image can never be found. In the debutter it looks like this
/C:/Documents%20and%20Settings/myname/workspace/gnupdf/bin/au/com/mysite/pdf/res/logo.png
What is with the leading '/' and the separators are not correct for windows.
I checked this path and it does not work in MS Explorer.
UPDATE
Ok, it is working to some extent except the image path is not correct, /C:/Documents%20and%20Settings/myname/workspace/gnupdf/bin/au/com/mysite/pdf/res/logo.png
is not a reference to a file, what is with the leading slash and the %20 space characters? How do I convert this into a file URL instead of a web url?