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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access