messagebox.java~3~

来自「J2ME的一个短消片发送Demo程序」· JAVA~3~ 代码 · 共 50 行

JAVA~3~
50
字号
package msgwma;

import javax.microedition.lcdui.*;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2008</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class messageBox extends TextBox implements CommandListener,Runnable {
    public messageBox() {
        super("Displayable Title", "", 50, TextField.ANY);
        try {
            jbInit();
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }

    Command sendCommand=new Command("send",Command.OK,1);

    private void jbInit() throws Exception {
        // Set up this Displayable to listen to command events
        setCommandListener(this);
        // add the Exit command
        this.addCommand(sendCommand);
        addCommand(new Command("Exit", Command.EXIT, 1));
    }

    public void commandAction(Command command, Displayable displayable) {
        /** @todo Add command handling code */
        if (command.getCommandType() == Command.EXIT) {
            // stop the MIDlet
            SMSSend.quitApp();
        }
    }

    public void run() {
    }

}

⌨️ 快捷键说明

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