0

I am working on a menu with just simple image

Image x = Image.createImage("numbers.png");
listMenu.append(counter, x);

it's working well on the emulators with the Micro Edition SDK 3 but when I use the Nokia emulator S40 or deploy to my mobile S60 it's not working, it gave me "Cannot read numbers.png"

any ideas?

Matthew
  • 44,826
  • 10
  • 98
  • 87
AMTourky
  • 1,190
  • 13
  • 25

1 Answers1

2

I recommend you put your images in a res folder in your MIDlet's root directory. Your createImage() call then becomes:

Image x = Image.createImage("/res/numbers.png");

funkybro
  • 8,432
  • 6
  • 39
  • 52
  • thx alot, it's working well. put please, can you justify why :) ! – AMTourky Mar 10 '11 at 08:37
  • Hi user628889! You should upvote as well as saying "thx" in the comments. It works because you're specifying an absolute path to the file, you're telling the handset exactly where to find it. – funkybro Mar 10 '11 at 08:47
  • 1
    :) sorry but I am new here, my reputation is 1 :( it need 15 rep. to upvote – AMTourky Mar 10 '11 at 09:33