Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How to read an image file from the JAR

From Wiki
Jump to: navigation, search
Article Metadata
Created: firt (15 Apr 2007)
Last edited: hamishwillee (30 Jul 2013)

To read an image file from the JAR to an Image object, you should use this code:

try {
Image logo = Image.createImage("/path_to_the_image");
catch ( e) {
System.err.println("Image read error");


  • You must use the first slash "/" to refer to the root of the JAR file.
  • You must include the image in the project to be included in the JAR file by the IDE you are using.
  • To be 100% standard to all devices, the image should be in PNG format. Many Nokia devices supports GIF, JPG and BMP to.
This page was last modified on 30 July 2013, at 08:09.
64 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.