Browser field

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

Class BrowserField
Supported since BlackBerry® Java® SDK 5.0
Example This screen shows a browser field.

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

Code sample: Creating 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");
    }
}
Next topic: Title bar
Previous topic: Other components

Was this information helpful? Send us your comments.