爱心技术专栏专题

我的J2ME编程联系(3)——Gauge

摘录:java高级 来源:java高级 加入时间:2006年11月06日
摘要:
我的J2ME编程联系(3)——Gauge


/* * gaugelet.java * * Created on 2005年4月15日, 下午5:19 */

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

/** * * @author  Adm…

转载:转载请保留本信息,本文来自
http://www.51dibs.com
/html/2006/article/info33/a_5ac35212d486c6fe.htm

我的J2ME编程联系(3)——Gauge

站点:爱心种子小博士 关键字:我的J2ME编程联系(3)——Gauge

   
我的J2ME编程联系(3)——Gauge

/* * gaugelet.java * * Created on 2005年4月15日, 下午5:19 */

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

/** * * @author  Administrator * @version */public class gaugelet extends MIDlet implements CommandListener{        private Gauge aGauge;    private Form aForm;    private Command exitCommand;    private Command okCommand;    private Display aDisplay;    private Alert anAlert;        public gaugelet(){                aForm=new Form("GaugeTest");        exitCommand=new Command("EXIT",Command.EXIT,1);        okCommand=new Command("OK",Command.OK,1);        aGauge=new Gauge("gaugedisplay",true,100,50);        anAlert=new Alert("Value",null,null,AlertType.INFO);                aForm.addCommand(exitCommand);        aForm.addCommand(okCommand);        aForm.append(aGauge);        aForm.setCommandListener(this);            }    public void startApp() {                aDisplay=Display.getDisplay(this);        aDisplay.setCurrent(aForm);    }        public void pauseApp() {    }        public void destroyApp(boolean unconditional) {    }        public void commandAction(Command c,Displayable d){                String s="The Value is ";        int i;                if(c==exitCommand){                        destroyApp(false);            notifyDestroyed();        }                else{                        i=aGauge.getValue();            s+=Integer.toString(i);            anAlert.setString(s);            aDisplay.setCurrent(anAlert,aForm);                                }    }}
关于我们 - 网站留言 - 友情链接 - 与我在线 - 与我聊天 - 领取红包 - TOP

客户服务中心信箱:info@51dibs.com 51dibs@gmail.com 网站地图

粤ICP备05020177号 声明

合作伙伴:深圳赫柏文化发展有限公司 健康百宝箱 东北人创业家园