Skip to main content

System freezes when using SDK 3.0 and an extended (open) menu of Commands

No replies
Joined: 2010-02-09

I am developing a midlet for a touch screen phone and using more Commands than there are softkeys, and so they form a menu.
When I use the Java(TM) Platform Micro Edition SDK 3.0 for the emulator (as is recommended), and in particular the Default FX Phone 1 (which is a touch screen phone emulator) the system keeps crashing. If I leave the menu extended, then after a small period of time, say a few minutes,( it varies), then the whole thing freezes and I have to close down and then restart my computer and reload netbeans. I haven't tried every phone in the list but at least four of them give the same results.
When I use Sun Java(TM) WirelessToolkit 2.5.2_01 for CLDC for the emulator and in particular the DefaultColorPhone, the problem doesn't occur. This is not an emulator for a touch phone and so I cannot really test without going on to my target device.
I have included a bare bones version of an app that will illustrate what happens.

import com.sun.lwuit.Display;
import com.sun.lwuit.Command;
import com.sun.lwuit.Form;
import javax.microedition.midlet.MIDlet;

public class Cash_Balance extends MIDlet implements ActionListener {

public void startApp() {
Form TitleForm = new Form("");

TitleForm.addCommand(new Command("EXIT",0));
TitleForm.addCommand(new Command("ONE",1));
TitleForm.addCommand(new Command("TWO",2));

public void actionPerformed(ActionEvent ae) {
Command cmd = ae.getCommand();
switch (cmd.getId())
{ case 0: notifyDestroyed();
// case 1:

public void pauseApp() { }
public void destroyApp(boolean unconditional) { }

Is this a problem with SDK 3.0 or is there something else that I can do to get around it.