wxlxb
发贴: 1
积分: 0
|
于 2005-01-09 14:52
运行下面范例,总是报错 Building "HLEventMIDlet" C:\WTK20\apps\HLEventMIDlet\src\HLEventMIDlet.java:3: HLEventMIDlet is not abstract and does not override abstract method startApp() in javax.microedition.midlet.MIDlet public class HLEventMIDlet extends MIDlet implements CommandListener ^ 1 error com.sun.kvem.ktools.ExecutionException Build failed
请教各位大虾,如何解决?
import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HLEventMIDlet extends MIDlet implements CommandListener { private Command exitCommand; private Command info1Command; private Command info2Command; private Display display; public HLEventMIDlet() { display = Display.getDisplay(this); exitCommand = new Command("Exit",Command.SCREEN,1); exitCommand = new Command("Info1",Command.SCREEN,2); exitCommand = new Command("Info2",Command.SCREEN,2); } public void startapp() { TextBox t = new TextBox("Hello MIDlet","Test string",256,0); t.setCommandListener(this); t.addCommand(exitCommand); t.addCommand(info2Command); t.addCommand(info1Command); display.setCurrent; } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command c,Displayable s) { if(c == exitCommand) { notifyDestroyed(); }else if (c == info1Command) { notifyDestroyed(); } }
}
|