Re: [jnc-users] Question on resources (images etc)
Status: Beta
Brought to you by:
soapy
From: Marco T. <mt...@gm...> - 2007-03-06 17:25:38
|
Friedhelm Hellerhoff wrote: > How do I have to load images for buttons etc? There shouldn't be a difference between native compiled apps and apps running in a JVM. Just make sure you compiled all resources into the binary. You seem to have done that... > I have seen in the FAQ, that I have to put them into a > separate jar and compile it as complete jar. > So I have put all resources in my src folder into a > jar that is used in the *.jnc file. Sounds good. Does that work when running in a JVM? Please make sure the JVM also uses the JAR and not the files from the filesystem. > The loading of images is done i.e. by > shell.setImage(SWTResourceManager.getImage(PictureMover.class, > "/de/fh/pictureMover/images/checkin_action.gif")); Please check if it works in a usual JVM. If not, you should consult the documentation of SWTResourceManager or ask Google on how to load resources from a Jar. Also you could check my examples (FileEncrypter or LittleUniverse) or JNC [1] itself. If it does work in a JVM, then it's a bug in GCJ/JNC. In this case, please send me a minimal example that works in a JVM but fails when native compiled. thanks Marco 1: http://javacompiler.svn.sourceforge.net/viewvc/javacompiler/trunk/src/ch/mtSystems/jnc/view/JNC.java?view=markup (Method "public static Image loadImage(String s)") |