Search…
Spinner

Overview

Spinner is a control that shows an image indicating that something is running in the background. It has two styles: iPhone and Android.
Could not load image

Source Code

SpinnerSample.java
1
//Spinner inside the Bar
2
Bar bar = new Bar (“text text”);
3
add(bar, LEFT, TOP, FILL, PREFERRED);
4
bar.createSpinner(Color.WHITE);
5
bar.startSpinner;
6
7
//Spinner inside the Loop
8
Spinner spinner = new Spinner(Spinner.IPHONE);
9
spinner.setForeColor(Color.WHITE);
10
add(spinner, CENTER, AFTER,, FONTSIZE + 200, FONTSIZE + 200);
11
12
while (Vm.getTimeStamp() < (Vm.getTimeStamp() + 5000))
13
{
14
spinner.update();
15
}
16
17
//Spinner inside the ProgressBox
18
Spinner.spinnerType = Spinner.ANDROID;
19
ProgressBox pb = new ProgressBox("Alert!", “msg”, null);
20
pb.setBackColor(Color.getRGB(12, 98, 200));
21
pb.popupNonBlocking();
Copied!

Methods

Type
Name
Description
Constructor
Spinner( )
Creates a simple Spinner
Constructor
Spinner(Image anim)
Creates a spinner from an animated GIF
Constructor
Spinner(int type)
Creates a spinner of the given type
boolean
isRunning( )
Returns if the spin is running
void
setImage(Image anim)
Changes the gif image of this Spinner
void
setType(int t)
Changes the Spinner to one of the predefined types
void
start( )
Starts the spinning thread
void
stop( )
Stops the spinning thread
void
update( )
Updates the spinner; call this when using the spinner inside a loop

References

Last modified 2yr ago