This example illustrates how to create command button in your form. Command class build to bind only the semantic information of the command it means command is not the actual action its contains only information about command. Command action is defined in CommandListener class with associated screen or form. Command contains three methods:
the label contains label of the commands, the type contains types of the command and the priority contains priority of the commands.
List of the Command Field:
For more, see the following example:
If user select the 'BACK' command then the commandAction() function will be called and check whether label is equal to 'BACK' then backCom() function will be called and display the form with alert object ('BACK Command') screen displays as below:
or when select the OK command the 'OK Command' will be displayed:
Source code of CommandExample.java
Posted on: October 3, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles