Skip to main content

Menu with a dialog

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
japstar
Offline
Joined: 2011-06-01

Hi,

I'm making a project for my final work and I have the following problem:
I've made a class that extends a dialog. In this class I create 3 commands and an actionlistener. So due the 3 commands, lwuit creates e menu. And the problem is that when I select a command in the menu, the menu freezes. The only thing i can do is click the cancel button, and the menu disappears. After I pressed the cancel buttonthe program continues, and the action i had selected before it froze, is still executed.

some background information: I firt make a bluetoothconnection with a PLC. This PLC then send me some data and of the data I make some buttons. When I press a button such a dialog appears. I don't know why the menu freezes when i press a command in the menu, because when I press a command in a menu somewehere else in my program, the menu works perfect.

Does anyone know what to do?

Greets,
Jasper

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07

You need to spawn a thread or use invokeAndBlock to process a long running task from a LWUIT event. See the many discussions about the LWUIT EDT.