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

[java] Graphics not loading in j2me

Started by CainUnable Apr 8, 2005 at 12:32 PM 2 replies 450+ views
Original Post
CainUnable
CainUnable
Hi, I'm fairly new to J2ME and decided to play around with it a bit. I wrote a simple little game that rolls 2 dice and displays them on the screen. I used the Sprite class to split a single image into the 6 faces for each of the dice. This all worked perfectly when I ran the program from the KToolbar program. It launches the emulator and the graphics display and change as desired. However, if I build the project and then try to execute the jad file, the emulator comes up and displays my program and some of the text, but the .png images never display. From what I can gather, the Dice objects (extended from the Sprite class) are never created. I have not been able to test it on an actual phone yet, so I am not sure if the graphics will load on a phone or not. Could anyone tell me if this is normal behavior or if I need to specify somewhere in kToolbar to load the graphics for deployment? Thanks.
Frank Henry
Frank Henry
Check your paths. You *should* have a "/" before the path no matter where the image is located.
CainUnable
CainUnable
The / is there. I found that out there hard way the first time I tested it. Thanks for trying though.
CainUnable
CainUnable
Finally found my problem. Windows (the wonderful thing it is...) set my file to .PNG in all caps. Since this is a work computer I hadn't set it to display the extentions so I never noticed it. /dice.PNG is working great now. Hopefully someone else can learn from my problem.

Topic Locked

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

Sign in to reply to this topic.