Problem in displaying images on handset
Hi all,
My code consists of displaying a set of J2ME images, i have used different forms for displaying different images.
It worked fi9 on emulator, but when i loaded its jar file on Nokia 6600 handset, i am unable to see the images.
Though application's name is visible.Bit depth is 24 and image format is .png. The code is as follows :
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.util.*;
public class testMIDlet extends MIDlet implements CommandListener
{
private final Command exit = new Command("Exit", Command.OK, 1);
private Form form1;
private Form form2;
private Form form3;
private Form form4;
private Form form57;
private Display display;
private ImageItem imageItem;
public void startApp()
{
System.out.println("In startApp .....");
display = Display.getDisplay(this);
//Create the form with a title
form57 = new Form("Wayfinder Application");
//Image and ImageItem
try {
Image image = Image.createImage("/57.png");
form57.append(image);
display.setCurrent(form57);
try{
Thread.sleep(500);
}
catch(InterruptedException IE)
{
System.out.println("exception caught");
}
form1 = new Form("Wayfinder Application.");
image = Image.createImage("/1.png");
form1.append(image);
display.setCurrent(form1);
try{
Thread.sleep(500);
}
catch(InterruptedException IE)
{
System.out.println("exception caught");
}
form2 = new Form("Wayfinder Application.");
image = Image.createImage("/2.png");
form2.append(image);
display.setCurrent(form2);
try{
Thread.sleep(500);
}
catch(InterruptedException IE)
{
System.out.println("exception caught");
}
form3 = new Form("Wayfinder Application");
image = Image.createImage("/3.png");
form3.append(image);
display.setCurrent(form3);
try{
Thread.sleep(500);
}
catch(InterruptedException IE)
{
System.out.println("exception caught");
}
form4 = new Form("Wayfinder Application");
image = Image.createImage("/4.png");
form4.append(image);
display.setCurrent(form4);
try{
Thread.sleep(500);
}
catch(InterruptedException IE)
{
System.out.println("exception caught");
}
}
catch (java.io.IOException e) {}
display.setCurrent(form57);
}
public void pauseApp()
{
System.out.println("In pauseApp .....");
}
public void destroyApp(boolean unconditional)
{
System.out.println("In destroyApp .....");
}
public void commandAction(Command c, Displayable disp)
{
if (c == exit)
{
destroyApp(false);
notifyDestroyed();
}
}
}
Message was edited by:
zibba

