图片显示问题,这段代码编译正常,运行正常,除了图片总是没有显示出来,怪异!
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Loading extends MIDlet implements CommandListener//logo
{
private Command enterCommand;
private Command exitCommand;
private Image StonemanImage;
private ImageItem imageItem;
//private Image MobileImage;
private form form;
private Display display;
public Loading()
{
try
{
StonemanImage = Image.createImage("/Duke.png");
}
catch(Exception e){}
imageItem = new ImageItem("stonemansoftware",StonemanImage,ImageItem.LAYOUT_CENTER,"#?@");
display = Display.getDisplay(this);
enterCommand = new Command("进入",Command.OK,1);
exitCommand = new Command("退出",Command.EXIT,1);
form = new form("stoneman software");
}
public void startApp()
{
//form.append(MobileImage);
form.append(imageItem);
form.addCommand(enterCommand);
form.addCommand(exitCommand);
form.setCommandListener(this);
display.setCurrent(form);
}
public void pauseApp(){}
public void destroyApp(boolean unconditional){}
public void commandAction(Command command, Displayable displayable) {
if (command == enterCommand)
{
System.out.println("进入系统");
}
if (command == exitCommand)
{
destroyApp(false);
notifyDestroyed();
System.out.println("退出系统");
}
}
}