Issues with Images and command listeners in J2ME

Conor026

Member
May 20, 2003
118
0
0
How do,

I`m developing a J2ME application but am having problems with:

I have this command listener line:
private Command exitCommand = new Command("Exit", Command.EXIT, 99);
But what does the "99" refer to.

The game is for a phone but how do you map the keys on a keypad (the specific phone is the Nokia 3510i, its a series 40).

I`m having awful trouble with images i have this code but it doesn`t work:

(inside the class)
Image Image1;

(inside a function)
try { Image1=Image.createImage("/logo_PNG.png");
}
catch(Exception e)
{
message="error";
}

The program runs but never displays the iimage, the picture just never goes into Image1.

Using the debug mode in JBuilder I get: Image1: javax.microedition.lcdui.Image = null
 

znaps

Senior member
Jan 15, 2004
414
0
0
Is the image stored in a JAR file?

I don't know much about J2ME stuff, but for J2SE if the image is in a JAR you need to use something like

ImageIcon image = new ImageIcon(getClass().getResource("/logo_PNG.png"));