1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

I am having trouble completing the following code in threads.

Discussion in 'Java' started by n.desai, Apr 1, 2008.

  1. n.desai

    n.desai New Member

    Joined:
    Apr 1, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.MIDlet;
    
    
    public class GaugeDemo extends MIDlet implements CommandListener {
        private static final Command CMD_EXIT = new Command("Exit", Command.EXIT, 1);
        private Display display;
        private NonInteractiveGaugeRunnable nonInteractive;
        private Form mainForm;
    
        public GaugeDemo() {
            display = Display.getDisplay(this);
            mainForm = new Form("Gauge Demo");
            nonInteractive = new NonInteractiveGaugeRunnable("Non Interactive", 10, 0);
            new Thread(nonInteractive).start();
            mainForm.append(nonInteractive);
            mainForm.addCommand(CMD_EXIT);
            mainForm.setCommandListener(this);
        }
    
    
        protected void startApp() {
            display.setCurrent(mainForm);
        }
    
        protected void destroyApp(boolean unconditional) {
            nonInteractive.setDone();
        }
    
        protected void pauseApp() {
        }
    
        public void commandAction(Command c, Displayable d) {
            destroyApp(false);
            notifyDestroyed();
        }
    } 
    
    and one more canvas class 
    
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.MIDlet;
    
    
    public class GaugeDemo extends MIDlet implements CommandListener {
        private static final Command CMD_EXIT = new Command("Exit", Command.EXIT, 1);
        private Display display;
        private NonInteractiveGaugeRunnable nonInteractive;
        private Form mainForm;
    
        public GaugeDemo() {
            display = Display.getDisplay(this);
            mainForm = new Form("Gauge Demo");
            nonInteractive = new NonInteractiveGaugeRunnable("Non Interactive", 10, 0);
            new Thread(nonInteractive).start();
            mainForm.append(nonInteractive);
            mainForm.addCommand(CMD_EXIT);
            mainForm.setCommandListener(this);
        }
    
    
        protected void startApp() {
            display.setCurrent(mainForm);
        }
    
        protected void destroyApp(boolean unconditional) {
            nonInteractive.setDone();
        }
    
        protected void pauseApp() {
        }
    
        public void commandAction(Command c, Displayable d) {
            destroyApp(false);
            notifyDestroyed();
        }
    }
    Could some one help me please.
     
    Last edited by a moderator: Apr 2, 2008

Share This Page