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.

Title bar

Use a title bar to provide BlackBerry device users with information at the top of your application. Most title bars contain only a title, but title bars can display the following items:

  • application icon, descriptive title, and time
  • application notifications, such as a new message indicator
  • wireless connection indicators, including the wireless coverage level, network coverage, GPS indicator, Bluetooth indicator, and Wi-Fi connection indicator
  • battery power indicator
  • active call indicator

Class

StandardTitleBar

Supported since

BlackBerry Java SDK 6.0

More information

For more information about title bars, see the UI Guidelines.

Example

This screen shows a title bar.

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

public class TitleBarDemo extends UiApplication 
{
    public static void main(String[] args)
    {
        TitleBarDemo theApp = new TitleBarDemo();
        theApp.enterEventDispatcher();
    }
    public TitleBarDemo()
    {
        pushScreen(new TitleBarDemoScreen());
    } 
}
class TitleBarDemoScreen extends MainScreen
{
    public TitleBarDemoScreen()
    {
        StandardTitleBar myTitleBar = new StandardTitleBar()
            .addIcon("my_logo.png")
            .addTitle("Title Bar Demo")
            .addClock()
            .addNotifications()
            .addSignalIndicator();
        myTitleBar.setPropertyValue(StandardTitleBar.PROPERTY_BATTERY_VISIBILITY,
            StandardTitleBar.BATTERY_VISIBLE_LOW_OR_CHARGING);
        setTitleBar(myTitleBar);
     }
}