Date field

Use a date field to display the date and time.

Class DateField
Supported since BlackBerry® Java® SDK 3.6
Example This screen shows a date field.

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

Code sample: Creating 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));
    }
}
Next topic: Date picker
Previous topic: Numeric drop-down list

Was this information helpful? Send us your comments.