⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 contextform.java

📁 客户端使用j2me ,服务器端使用web services技术的新闻查看系统
💻 JAVA
字号:
package com.wy.ch17;

import javax.microedition.lcdui.*;


public class ContextForm extends MemoryForm implements CommandListener {
    private String context;
    private Command QuitCommand;
    private Command BackCommand;
    public ContextForm(Displayable d, String c, String t) {
        super(t, d);
        context = c;
        if (context != null) {
            this.append(context);
        } else {
            this.append("出错,请重试");
        }
        QuitCommand = new Command("退出", Command.EXIT, 1);
        {
            BackCommand = new Command("后退", Command.BACK, 1);
        }
        this.addCommand(QuitCommand);
        this.addCommand(BackCommand);
        this.setCommandListener(this);
    }

    public void commandAction(Command command, Displayable displayable) {
        if (command == QuitCommand) {
            MainMIDlet.getInstance().notifyDestroyed();
        }
        if (command == BackCommand) {
            Display.getDisplay(MainMIDlet.getInstance()).setCurrent(
                    getDisplayable());
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -