Command-Processing Scenario

The scenario for command processing in the MIDP is conceptually similar to other GUI toolkits. A command listener is an object that receives notifications of the occurrence of commands. Command listeners register to receive notification of commands.

Some external action, such as the user press of a button, results in the MIDP implementation detecting the event and associating it with the currently displayed screen. It encapsulates the event in a Command object. A registered command listener receives notification of the event. The listener then takes some action that represents the behavior of the command.

Commands can only be associated with Displayable widgets. That is, you can add or remove Command objects to and ...

Get Wireless J2ME™ Platform Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.