Sorry about the red box, but we really need you to update your browser. Read this excellent article if you're wondering why we are no longer supporting this browser version. Go to Browse Happy for browser suggestions and how to update.

Choice field: date field

Use a date field to display the date and time.

Class

DateField

Supported since

BlackBerry Java SDK 3.6

More information

For more information about date fields, see the UI Guidelines.

Example

This screen shows a date field.

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;

public class DateFieldDemo extends UiApplication 
{ 
    public static void main(String[] args) 
    { 
        DateFieldDemo theApp = new DateFieldDemo(); 
        theApp.enterEventDispatcher(); 
    } 
    public DateFieldDemo() 
    { 
        pushScreen(new DateFieldDemoScreen()); 
    } 
}
class DateFieldDemoScreen extends MainScreen 
{
    public DateFieldDemoScreen() 
    {
        setTitle("Date Field Demo"); 
        add(new DateField("Date and Time: ", 
            System.currentTimeMillis(), DateField.DATE_TIME));
    }
}