手游问题在eclipse上报错,WTK上没问题.代码如下:

发布时间:2024-06-15 22:11 发布:上海旅游网

问题描述:

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class M3GMIDlet extends MIDlet implements CommandListener {
private Command exitCommand = new Command("Exit", Command.EXIT, 1);

/**
* Starts application and shows the list of samples. The user can select a
* sample for execution and return to the selection screen.
*/
public void startApp() {

M3GCanvas mCanvas = new M3GCanvas();
mCanvas.addCommand(exitCommand);
mCanvas.setCommandListener(this);
Display.getDisplay(this).setCurrent(mCanvas);
}

/**
* Not used.
*/
public void pauseApp() {
}

/**
* Not used.
*/
public void destroyApp(boolean unconditional) {
}

/**
* Receives the command actions from the selection screen as well as the
* sample screens.
*
* @param command
* command
* @param displayable
* source of the command
*/
public void commandAction(Command command, Displayable displayable) {
if (command == exitCommand) {

destroyApp(true);
notifyDestroyed();
}

}
}

问题解答:

手游问题在eclipse上报错,WTK上没问题.代码如下:这个旅游问答期待您的解答,请登录账号或关注微信公众号回答这个问题。

热点新闻