站内搜索: 请输入搜索关键词
当前页面: 图书首页 > Programming Wireless Devices with the Java2 Platform

Programming Wireless Devices with the Java2 Platform

[ directory ] Previous Section Next Section

Chapter 11. MIDP Low-Level User Interface Libraries

While the high-level user interface API provides maximum portability and development ease, some applications require greater control over the user interface.

The MIDP low-level user interface API is designed for applications that need precise placement and control of graphic elements as well as access to low-level input events. Typical examples of application components that might utilize the low-level user interface API are a game board, a chart object, or a graph.

Using the low-level user interface API, an application can:

  • control precisely what is drawn on the display,

  • handle primitive events like key presses and key releases, and

  • access concrete keys and other input devices.

Applications that program to the low-level user interface API can be portable if the application uses only the standard features; applications should stick to the platform-independent part of the low-level API whenever possible. This means that applications should not directly assume the presence of any keys other than those defined in class Canvas. Also, applications should inquire about the size of the display and adjust their behavior accordingly.

    [ directory ] Previous Section Next Section