J2ME code not running properly

From: priyanka (priyanka30maheshwari_at_indiatimes.com)
Date: 01/23/04


Date: 22 Jan 2004 21:10:46 -0800

In the progrram below I want that it should show filling of Gauge bars
one by one just like at the time of loading.I am using J2ME Wireless
Toolkit 1.0.4 with KToolbar.Here is the program code.So kindly help
me....

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

public class MyGauge extends MIDlet implements CommandListener {
        Display display;
        int i=0;
        Command start=new Command("Start",Command.SCREEN,1);
        Form frm=new Form("");
        Gauge gauge = new Gauge ("Loading... Please wait.",false,7,0);
        public MyGauge() {
                display = Display.getDisplay(this);
                frm.addCommand(start);
                frm.append(gauge);
                display.setCurrent(frm);
                frm.setCommandListener(this);
        }
        public void startApp() {
                    display.setCurrent(frm);
          }
          public void destroyApp(boolean unconditional) {
          }
          public void pauseApp() {
          }
          public void commandAction(Command c,Displayable d) {
                  try {
                  
                           for (int j=0;j<=7;j++) {
                                  gauge.setValue(j);
                                Thread.sleep(1000);
                           }
                   }
                   catch(InterruptedException ie){
                  }
          }
}