[java] J2ME
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.
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:
Once you package the file, though, you can load the image via:
Image sprite = Image.createImage("./HAND.png");
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.
"./HAND.png" will try to get it from within the current package, which is rarely where people put their resources by default.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement