• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Issues with Images and command listeners in J2ME

Conor026

Member
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
 
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"));
 
Back
Top