Hecl Builder

Easy Mobile Applications

CommandExample
Download: .jad .jar
2.0/5 Average rating:

MIDP Version: 2.0
Description: lcdui.command example
Last updated: Wed Oct 15 09:06:33 +0000 2008 by davidw

set exitcmd [lcdui.command -label Exit -longlabel Exit -type exit -priority 2]
set backcmd [lcdui.command -label Back -longlabel Back -type back -priority 1]
set addtextcmd [lcdui.command -label AddText -longlabel AddText -type screen -priority 1]

proc NewForm {} {
    global exitcmd
    global backcmd
    global addtextcmd
    set form [lcdui.form -title "Commands" -commandaction HandleCmd]
    $form setcurrent
    $form addcommand $exitcmd
    $form addcommand $backcmd
    $form addcommand $addtextcmd
}

proc HandleCmd {cmd form} {
   global exitcmd
   global backcmd
   if { eq $cmd $backcmd } {
   	NewForm
   } elseif { eq $cmd $exitcmd } {
   	[lcdui.alert -title "Goodbye" -text "Goodbye!" -type info -timeout forever] setcurrent
        after 1000 midlet.exit
   }
   $form append "Blah blah"
}

NewForm


Note: If you have trouble with the applets on this site, you might try upgrading your Jave Runtime Environment, in order to get the "Next-Generation Java Plug-In", available for download here: http://download.java.net/jdk6/