Command start = new Command("开始",Command.OK,1) ;
Command stop = new Command("停止",Command.STOP,1) ;
al.addCommand(start);
al.addCommand(stop);
al.setCommandListener(this);
display.setCurrent(al);
}
public void commandAction(Command c,Displayable s)
{
String cmd = c.getLabel() ;
if(cmd.equals("开始"))
{
for(int i=0 ; i <11 ; i++)
{
g.setValue(i);
try
{
Thread.sleep(500);
}catch(Exception e){}