A.2 UI Model After the MIDlet is started, it can retrieve a reference to the current display screen from the Display.getDisplay(this) method. Now, we can add UI widgets in the LCDUI package to the screen. We must also associate an event handler to the screen. The handler listens to and handles UI events generated by the user to this screen. The handler implements the CommandListener interface, which declares one method, commandAction(). Since the commandAction() method is required to return quickly to avoid UI blocking, lengthy event handling actions are processed in separate threads. |