report.java

来自「《开发Nokia S40应用程序》源码(8-10章) 《开发Nokia S40」· Java 代码 · 共 49 行

JAVA
49
字号
package com.Series40Book;

import javax.microedition.lcdui.*;


public class Report extends Form
         implements CommandListener {

  private Command exit;
  private Command start;

  public Report (String status) {
    super ("Report");

    exit = new Command ("Exit", Command.EXIT, 1);
    start = new Command ("New entry", Command.OK, 1);
    addCommand (exit);
    addCommand (start);
    setCommandListener (this);

    append (status);
    append(new StringItem("Message", BlogClient.message));
    if (BlogClient.photoData != null) {
      // Image img =
      //    Image.createImage (BlogClient.photoData, 0,
      //         BlogClient.photoData.length);
      // append (new ImageItem(
      //     "Image size is " + BlogClient.photoData.length,
      //     img, ImageItem.LAYOUT_CENTER, "image"));
      append ("Photo length is " +
              BlogClient.photoData.length);
    }

    if (BlogClient.audioData != null) {
      append ("Audio clip length is " +
              BlogClient.audioData.length);
    }
  }

  public void commandAction (Command c, Displayable d) {
    if (c == exit) {
      BlogClient.exit ();
    } if (c == start) {
      BlogClient.initSession ();
      BlogClient.showCamera ();
    }
  }
}

⌨️ 快捷键说明

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