| How to add resources (e.g. pics) to J2ME JAR file? [message #525791] |
Wed, 07 April 2010 15:43 |
Eclipse User |
|
|
|
I know this must have a simple answer, but I'm stumped.
I just need to add a standard resource (e.g. data file, or picture, or whatever) into the JAR for my J2ME MIDP program to access at runtime. How or where does one do this in Eclipse?
I managed it fine with adding a JAR library to my project in the Java Build Path but not sure what to select for non-JAR files (i.e. general data files of any sort).
In my specific case I'm trying to add a theme file for the LWUIT library to use. I tried just copying the .res file into the /res directory of my project in the workspace but it doesn't seem to be accessible at runtime.
The code being:
try {
Resources r = Resources.open("/res/LWUITtheme.res");
UIManager.getInstance().setThemeProps(r.getTheme("LWUITtheme "));
} catch (IOException ioe) { }
and I'm just getting a java.lang.NullPointerException: 0 at runtime for on the Resources.open line.
Any ideas please?
Many thanks,
Alex
|
|
|
Powered by
FUDForum. Page generated in 0.07607 seconds