Hi Christian,
On Thu, 17 Jan 2013, Christian Kreutzfeldt wrote:
> I have a number of Image Icons which are exposed in some Swing dialogs
> generated by plugins. I want to pack them into a common jar file, but
> the plugins fail to find them there.
>
> What would be the right way to do that and where to place such jar file?
The common way is to refer to those files via URLs. Such URLs have the
form:
jar:file:/path/to/my.jar!/resources/123.gif
and are typically retrieved by Java code like this:
URL iconURL = getClass().getResource("/resources/123.gif");
The ImageIcon(URL) constructor comes in real handy with that strategy:
http://docs.oracle.com/javase/1.4.2/docs/api/javax/swing/ImageIcon.html#ImageIcon%28java.net.URL%29Ciao,
Johannes
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html