Lists (Cont.)
Gauge gauge = new Gauge( "Progress Bar", false, 20, 9 );
- The class javax.microedition.lcdui.Gauge implements a bar graph display of a value intended for use in a form.
- The constructor public Gauge(String label, boolean interactive, int maxValue, int initialValue) creates a new
Gauge
object with the following parameters:
label
— the Gauge
's label,
interactive
— interactive or non-interactive mode.
In interactive mode, the user is allowed to modify the value.
maxValue
— The maximum value must be greater than zero.
initialValue
— The initial value must be within the range zero to maxValue
, inclusive.
For example, consider a Gauge
object that has a range of values from zero to 99, running on a device that displays the Gauge
's approximate value using a set of one to ten bars.
The device might show one bar for values zero through nine, two bars for values ten through 19, three bars for values 20 through 29, and so forth.
TextField textfield = new TextField( "TextField Label", "abc", 50, 0 );