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.

Text field: email address

Use an email address field when BlackBerry device users are required to type an email address. This field permits only characters that are valid in an email address.

The first space that a user types is replaced automatically with an at sign (@) and any subsequent spaces are replaced with periods (.).

Class

EmailAddressEditField

Supported since

BlackBerry Java SDK 4.0

More information

For more information about email address fields, see the UI Guidelines.

Example

This screen shows an email address field.

import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.component.EmailAddressEditField;

public class EmailAddressEditFieldDemo extends UiApplication
{
    public static void main(String[] args) 
    {
        EmailAddressEditFieldDemo theApp = new EmailAddressEditFieldDemo();
        theApp.enterEventDispatcher();
    }
    
    public EmailAddressEditFieldDemo()
    {
        pushScreen(new EmailAddressEditFieldDemoScreen());
    }
}

class EmailAddressEditFieldDemoScreen extends MainScreen
{
    public EmailAddressEditFieldDemoScreen()
    {
        setTitle("Email Address Field Demo");
        EmailAddressEditField enterEmail = new EmailAddressEditField("Email address: ", "");
        add(enterEmail);
    }
}