J2ME code not running properly

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • priyanka

    J2ME code not running properly

    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.microedit ion.midlet.*;
    import javax.microedit ion.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.getDisp lay(this);
    frm.addCommand( start);
    frm.append(gaug e);
    display.setCurr ent(frm);
    frm.setCommandL istener(this);
    }
    public void startApp() {
    display.setCurr ent(frm);
    }
    public void destroyApp(bool ean unconditional) {
    }
    public void pauseApp() {
    }
    public void commandAction(C ommand c,Displayable d) {
    try {

    for (int j=0;j<=7;j++) {
    gauge.setValue( j);
    Thread.sleep(10 00);
    }
    }
    catch(Interrupt edException ie){
    }
    }
    }
Working...