• Advertisement
Sign in to follow this  

[java] J2ME

This topic is 3554 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi every body i'm a beginner in programmation of application for mobile.Now i have a problem with SPRITE.I create an image and it's in my local disk named 'D'.I want to know how to indicate the location of the image very simply.The name of my image is HAND. Thanks to answer.

Share this post


Link to post
Share on other sites
Advertisement
In J2ME, all resources available to the application must be packaged inside of the .jar file associated with the application.

Once you package the file, though, you can load the image via:

Image sprite = Image.createImage("./HAND.png");

Share this post


Link to post
Share on other sites
Actually, you should use "/HAND.png" or any subdirectory you put it into, like "/res/HAND.png"

"./HAND.png" will try to get it from within the current package, which is rarely where people put their resources by default.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement