Sign in to follow this  
patrickboss

[java] J2ME

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this