Java Reference
In-Depth Information
Figure 7-4.
StationSign in action in a Form
Summary
This chapter described MIDP's support for custom items. The
CustomItem
class is the basis of items
you can write to include in
Form
s. You can determine the custom item's appearance in the
paint()
method by drawing using a
Graphics
object. Callback methods throughout
CustomItem
let you know when the item is shown or hidden and deliver key, pointer, and traversal events.
Two examples,
SimpleItem
and
StationSign
, provided a foundation of working code that you
can adapt to build your own items.
A word of caution is appropriate here. While custom items allow almost unlimited flexibility
for creating new
Form
items, it is quite difficult to create a
CustomItem
that has a consistent look
and feel with the rest of the standard MIDP
Form
items. Testing can be intensive if the final
application has to run across different devices with different MIDP implementations.
Search WWH ::
Custom Search