public class FixedRateScheduleMIDlet extends MIDlet implements CommandListener {
private Command exitCommand = new Command("Exit", Command.EXIT, 1);
private Display display;
TextBox t= new TextBox("Time setting", "", 256, 0);
private Timer aTimer= new Timer();
private Date currentTime= new Date();
private Calendar now = Calendar.getInstance();
public FixedRateScheduleMIDlet() {
display = Display.getDisplay(this);
now.setTime(currentTime);
}
public void startApp() {
ClockTimerTask aTimerTask = new ClockTimerTask();
aTimer.schedule(aTimerTask, 1000, 1000);
t.addCommand(exitCommand);
t.setCommandListener(this);
display.setCurrent(t);
}
read more...
No comments:
Post a Comment