Skip to main content



      Home
Home » Newcomers » Newcomers » How to add resources (e.g. pics) to J2ME JAR file?
How to add resources (e.g. pics) to J2ME JAR file? [message #525791] Wed, 07 April 2010 15:43
Eclipse UserFriend
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
Previous Topic:Need Help - Using Eclipse with MKS Source Integrity
Next Topic:Life-cycle of ObjectContribution within org.eclipse.ui.popupMenus
Goto Forum:
  


Current Time: Sat Nov 08 05:59:31 EST 2025

Powered by FUDForum. Page generated in 0.07607 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top