Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] J2ME

Started by patrickboss Jul 28, 2008 at 2:09 PM 1 replies 1.1k views
Original Post
patrickboss
patrickboss
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.
trojanman
trojanman
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");
Thygrrr
Thygrrr
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.