Archive for the 'timer' Category

Simple demo of using timers

import java.util.*;import javax.microedition.midlet.*;import javax.microedition.lcdui.*;
public class TimerMidlet extends MIDlet implements CommandListener{ private Display display; private Form form; private Command exit; private Command stop; private Timer timer; private RunTimerTask tt; […]

A utility of startTimer

// Starts a timer to run a simple taskprivate void startTimer( ) {
// Create a task to be run task = new TimerTask( ) {
private boolean isPaused; private int count;
[…]