diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/cldc/randoms.check | 1 | ||||
-rw-r--r-- | test/files/cldc/randoms.scala | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/files/cldc/randoms.check b/test/files/cldc/randoms.check new file mode 100644 index 0000000000..e73fdf3e4f --- /dev/null +++ b/test/files/cldc/randoms.check @@ -0,0 +1 @@ +Execution completed. diff --git a/test/files/cldc/randoms.scala b/test/files/cldc/randoms.scala new file mode 100644 index 0000000000..b9f46250c9 --- /dev/null +++ b/test/files/cldc/randoms.scala @@ -0,0 +1,29 @@ +import javax.microedition.lcdui._ +import javax.microedition.midlet.MIDlet + +class Test extends MIDlet with CommandListener { + + def startApp { + val display = Display.getDisplay(this) + + val mainForm = new Form("randoms") + mainForm append "Welcome to the world of MIDlets!" + mainForm append "(build with Scala)" + //val rnd = new Random + //for (i <- 0 until 10) mainForm append rnd.nextInt.toString + + val exitCommand = new Command("Exit", Command.EXIT, 0) + mainForm addCommand exitCommand + mainForm setCommandListener this + + display setCurrent mainForm + } + def pauseApp {} + + def destroyApp(unconditional: Boolean) {} + + def commandAction(c: Command, s: Displayable) { + if (c.getCommandType == Command.EXIT) + notifyDestroyed + } +} |