piechartmidlet.java

来自「j2me的程序」· Java 代码 · 共 33 行

JAVA
33
字号

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

public class PieChartMIDlet extends MIDlet implements CommandListener{

    private Command exitCommand;
    private Display display;



  public void startApp() {
	Display display = Display.getDisplay(this);

    int[] data={10,20,30,40,20};
    Displayable d = new PieChartCanvas(data);
    exitCommand = new Command("离开", Command.EXIT, 1);

    d.addCommand(exitCommand);
    d.setCommandListener(this);

    display.setCurrent(d);
  }

  public void pauseApp() {}

  public void destroyApp(boolean unconditional) {}
  public void commandAction(Command c, Displayable s) {
          notifyDestroyed();
  }
}

⌨️ 快捷键说明

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