大家好,我是个初学者用的WTK22 看了书上的一个程序
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class Infotest extends MIDlet implements CommandListener{
private Display display;
public InfoTest(){
display = Display.getDisplay(this);
protected void startApp(){
Alert alert = new Alert("手机信息测试");
alert.setTimeout(Alert.FOREVER);
String icon = "/icon/hehe";
try {
Image image = Image.createImage(icon);
alert.setimage(image);
}catch(java.io.IOException x ){}
display.setCurrent(alert);
}
public void commandAction(Command c ,Displayable d ){
}
protected void pauseApp(){
}
protected void destroyApp(boolean unconditional){
}
} 他书NO RES COMLIES
------解决方案--------------------------------------------------------
public InfoTest(){
alert.setimage(image);
大小写错了. 还有构造函数少了个}