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.

Activity field: gauge

Use a gauge field to create a horizontal bar to display a progress indicator or a numeric value.

Class

GaugeField

Supported since

BlackBerry Java SDK 4.2

More information

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

Example

A screen shot of a gauge field.

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

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

class GaugeFieldDemoScreen extends MainScreen
{
    public GaugeFieldDemoScreen ()
    {
        setTitle("Gauge Field Demo");
        
        GaugeField percentGauge = 
              new GaugeField("Percent: ", 1, 100, 29, GaugeField.PERCENT);
        add(percentGauge);
    }
}