Java Reference
In-Depth Information
Display.getDisplay(this).setCurrent(sweeper);
}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
}
And here's the code for SweepCanvas :
import javax.microedition.lcdui.*;
public class SweepCanvas
extends Canvas
implements Runnable {
private boolean mTrucking;
private int mTheta;
private int mBorder;
private int mDelay;
public SweepCanvas() {
mTheta = 0;
mBorder = 10;
mDelay = 50;
}
public void start() {
mTrucking = true;
Thread t = new Thread(this);
t.start();
}
public void stop() {
mTrucking = false;
}
public void paint(Graphics g) {
int width = getWidth();
int height = getHeight();
// Clear the Canvas.
g.setGrayScale(255);
g.fillRect(0, 0, width - 1, height - 1);
Search WWH ::




Custom Search