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.

Browser field

Use a browser field to display web content in a BlackBerry device application.

Class

BrowserField

Supported since

BlackBerry Java SDK 5.0

More information

For more information about browser fields, see the UI & Navigation Development Guide.

Example

This screen shows a browser field.

import net.rim.device.api.browser.field2.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;

public class BrowserFieldDemo extends UiApplication
{
    public static void main(String[] args)
    {
        BrowserFieldDemo app = new BrowserFieldDemo();
        app.enterEventDispatcher();
    }

    public BrowserFieldDemo()
    {
        pushScreen(new BrowserFieldDemoScreen());
    }
}

class BrowserFieldDemoScreen extends MainScreen
{
    public BrowserFieldDemoScreen()
    {
        BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
        myBrowserFieldConfig.setProperty(
              BrowserFieldConfig.NAVIGATION_MODE,
              BrowserFieldConfig.NAVIGATION_MODE_POINTER);
        BrowserField browserField = new BrowserField(myBrowserFieldConfig);
        
        add(browserField);
        browserField.requestContent("http://www.blackberry.com");
    }
}