/* スクロールのテスト Ver 0.00 */ /* */ /* */ /* by Atsushi 2000/7/24 */ import java.util.Timer; import javax.microedition.lcdui.*; import javax.microedition.midlet.*; public class ScrollTest extends MIDlet implements CommandListener { /* --- Field --- */ private Display display; private Command exit; private DoubleBufferedCanvas canvas; private Timer timer; /* --- Constructor --- */ public ScrollTest() { display=Display.getDisplay(this); exit=new Command("Exit",Command.SCREEN,2); } /* --- 開始・終了 --- */ public void startApp() { canvas=new DoubleBufferedCanvas(); canvas.addCommand(exit); canvas.setListener(this); display.setCurrent(canvas); timer=new Timer(); timer.scheduleAtFixedRate(new ScrollTestTask(canvas),0,1000/24); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } /* --- イベント --- */ public void commandAction(Command c,Displayable s) { if (c==exit) { destroyApp(false); notifyDestroyed(); } } }