以文本方式查看主题

-  课外天地 李树青  (http://njcie.com/bbs/index.asp)
--  JavaME移动开发课件  (http://njcie.com/bbs/list.asp?boardid=18)
----  程序代码——可以调节的Gauge  (http://njcie.com/bbs/dispbbs.asp?boardid=18&id=546)

--  作者:admin
--  发布时间:2008/9/25 10:11:46
--  程序代码——可以调节的Gauge

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Gauge;
import javax.microedition.midlet.MIDlet;

public class Exec extends MIDlet implements CommandListener {
        Display display;
        Form form = new Form("表单");
        Gauge g = new Gauge("示例", true, 10, 5);
        Command start = new Command("开始", Command.OK, 1);

        public Exec() {
                display = Display.getDisplay(this);
        }

        public void startApp() {
                form.append(g);
                form.addCommand(start);
                form.setCommandListener(this);
                display.setCurrent(form);
        }

        public void commandAction(Command c, Displayable s) {

        }

        public void pauseApp() {
        }

        public void destroyApp(boolean unconditional) {
        }
}

[此贴子已经被作者于2010-12-12 18:32:32编辑过]