Hi All,
Apologies if I use the wrong terminology for this - I’m still learning!
I have a Java script library in Domino in which I’ve written a class. I want to be able to use a particular GIF file from within a couple of my class methods and it seems that the perfect place to keep this GIF file is in the Resources (Res) section of my Java Library. I imported my file using the ‘Import\Resource’ action button in my Java Library but am now stumped as to how to refer to this from within my code. Anyone know?
Thanks,
Emily.
P.S For clarification, this is NOT an Image Resource, it is actually stored within the Java library itself.
Subject: Re: How to refer to Java Resources from within the code
In a flash of inspiration, I realised what would be the right way of finding this out. A Google search for ‘jar image file’ gave me the code: getClass().getResource(“imagename.gif”). This didn’t work, but led me onto getClass().getClassLoader().getResource(“imagename.gif”) which also didn’t work, but then searching for ‘domino java getResource’ led me to this blog: http://www.bleedyellow.com/blogs/DominoHerald/entry/use_image_resource_in_java2?lang=en
which is exactly what I was trying to do.
I’m not sure whether I’m annoyed or pleased that I got so close to the answer myself!
Emily.