Command and Event Handling

With a Canvas component, you can add and remove high-level commands and set a single command listener to a canvas, just as you can with other displayable components. A Canvas can also implement CommandListener and register itself as its own listener.

In addition to handling high-level commands, however, the Canvas class also handles low-level commands. Canvas components themselves are the source of low-level key and pointer events, which are generated by user key actions and pointer movement on the device. They are also their own low-level event listeners. The Canvas class defines the interface for low-level event handling as part of its own API; there is no other listener interface to implement.

The MIDP implementation ...

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.