Skip to main content

Can javax.microedition.lcdui.Display and com.sun.lwuit.Display be used together?

3 replies [Last post]
negito
Offline
Joined: 2004-03-21
Points: 0

I use a javax.microedition.lcdui.Display to display a dialog. Then I use com.sun.lwuit.Display to display a form. The form can not be displayed on nokia symbian 3. But it works with MOTODEV emulator. Please pay attention about the comment in the example code.
protected void startApp() throws MIDletStateChangeException {
Alert loadingDlg = new Alert( null, "LOADING...", null, null );
Gauge indicator = new Gauge( null, false, 100, 0 );
loadingDlg.setIndicator(indicator );
// When no this code, the form can be displayed.
javax.microedition.lcdui.Display.getDisplay(this)
.setCurrent( loadingDlg );

Display.init(this);

mainForm = new Form();
textArea = new TextArea( "ABC" );

mainForm.show();
}

Is there any known issue about it? It is LWUIT 1.5.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
negito
Offline
Joined: 2004-03-21
Points: 0

Maybe I found a way about this. That is call lcduiDisplay.setCurrent( null ), before the LWUIT form displaying. I tested it on the nokia symbian 3.

gt8887b
Offline
Joined: 2010-03-15
Points: 0

From my experience with LWUIT it is not a good idea to mix it with LCDUI. LWUIT EDT thread is separate from LCDUI main thread and LWUIT is not designed to be multi-threaded. It is great that your solution is working, but I would recommend using LWUIT Dialog class instead the LCDUI one.

negito
Offline
Joined: 2004-03-21
Points: 0

I know. But the lwuit Display takes time to be initialized. On nokia e71, it takes about several seconds. I must give the user a hint that the app is running. So I need LCDUI to display a dialog for this.