Could somebody explain me, why that short midlet doesn’t work as it should.
The result should looks like this:Code:import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Abcdef extends MIDlet implements CommandListener { private Command exitCommand; private Form dataViewForm; int x; public Abcdef() { dataViewForm = new Form("Serial Data Viewer"); exitCommand = new Command("Exit", Command.EXIT, 1); dataViewForm.addCommand(exitCommand); dataViewForm.setCommandListener(this); for(x=0;x<10;x++){ dataViewForm.append("ABCDEFGH \n"); System.out.println("ABCDEFGH"); try{ Thread.sleep(1000); }catch(InterruptedException e){} } } protected void startApp() { Display.getDisplay(this).setCurrent(dataViewForm); } protected void pauseApp() {} protected void destroyApp(boolean bool) {} public void commandAction(Command cmd, Displayable disp) { if (cmd == exitCommand) { destroyApp(false); notifyDestroyed(); } } }
But the result is:Code:ABCDEFGH // 1 sec. Pause ABCDEFGH // 1 sec. Pause ABCDEFGH // 1 sec. Pause ABCDEFGH // 1 sec. Pause ABCDEFGH // 1 sec. Pause ABCDEFGH // 1 sec. Pause ABCDEFGH // 1 sec. Pause ABCDEFGH // 1 sec. Pause ABCDEFGH // 1 sec. Pause ABCDEFGH
On the console WTK result is ok, but on emulator WTK result isn’t ok.Code://10 sec. Pause ABCDEFGH ABCDEFGH ABCDEFGH ABCDEFGH ABCDEFGH ABCDEFGH ABCDEFGH ABCDEFGH ABCDEFGH ABCDEFGH

Reply With Quote


