More Item Components

The previous examples covered some of the components that build the foundation for all MIDP applications. In the rest of this chapter, you'll see the remaining UI components.

DateField

On the main screen of the UIComponent demo application (see http://www.phptr.com/), the second element of the list is a demo of the DateField class. Figure 5.1 indicates that DateField is a kind of Item; as such, it must be part of a Form in order to be displayed. Listing 5.5 shows the source code for the DateFieldDemo.java file.

Code Listing 5.5. Because screens are displayable, the getInstance() method should return a screen object of some kind. This one returns an instance of the Form.
 import java.util.Date; import java.util.Calendar; import ...

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.