国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

一個(gè)簡單的CustomItem使用案例

2019-11-18 16:06:08
字體:
供稿:網(wǎng)友
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class SimpleItemMIDlet extends MIDlet
    implements CommandListener {
  public void startApp() {
    Form form new Form("SimpleItemMIDlet");
    form.append(new SimpleItem("SimpleItem"));

    Command c = new Command("Exit", Command.EXIT, 0);
    form.addCommand(c);
    form.setCommandListener(this);

    Display.getDisplay(this).setCurrent(form);
  }

  public void pauseApp() {}

  public void destroyApp(boolean unconditional) {}
  public void commandAction(Command c, Displayable s) {
    if (c.getCommandType() == Command.EXIT)
      notifyDestroyed();
  }
}

 class SimpleItem extends CustomItem {
  public SimpleItem(String title) { super(title); }
  // CustomItem abstract methods.
  public int getMinContentWidth() { return 100; }
  public int getMinContentHeight() { return 60; }
  public int getPRefContentWidth(int width) {
    return getMinContentWidth();
  }
  public int getPrefContentHeight(int height) {
    return getMinContentHeight();
  }
  public void paint(Graphics g, int w, int h) {
    g.drawRect(0, 0, w - 1, h - 1);
    g.setColor(0x000000ff);
    int offset = 0;
    for (int y = 4; y < h; y += 12) {
      offset = (offset + 12) % 24;
      for (int x = 4; x < w; x += 24) {
        g.fillTriangle(x + offset,     y,
                       x + offset - 3, y + 6,
                       x + offset + 3, y + 6);
      }
    }
  }
}

(出處:http://m.survivalescaperooms.com)



發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 阿拉善左旗| 民乐县| 昌乐县| 宁津县| 东宁县| 肥乡县| 莱阳市| 宝坻区| 贵阳市| 水富县| 玛多县| 勐海县| 遵义县| 南平市| 大冶市| 乡城县| 长顺县| 靖边县| 丹巴县| 湘阴县| 莱芜市| 聂拉木县| 冕宁县| 万全县| 获嘉县| 梁河县| 景泰县| 新蔡县| 榆中县| 子长县| 宣武区| 门源| 双鸭山市| 绥滨县| 铁岭市| 莎车县| 丰城市| 三亚市| 余庆县| 疏勒县| 峨眉山市|