LWUIT includes the concept of a command. A command is something that your user can do in your application.
LWUIT includes the concept of a command. A command is something that your user can do in your application. LWUIT decides how to show the command on the screen and how the user makes it happen. Usually, commands are assigned to the soft buttons on a mobile phone. LWUIT will normally show commands as labels at the bottom corners of the screen; the user can invoke them by pressing the corresponding soft button. On touch devices, the user can touch directly on a command to invoke it.
Command(java.lang.String command)
-Creates a new instance of Command
Command(java.lang.String command, Image icon)
-Creates a new instance of Command
Command(java.lang.String command, Image icon, int id)
-Creates a new instance of Command
Command(java.lang.String command, int id)
-Creates a new instance of Command
Create a command,
Command exitCommand = new Command("Exit");
Add the command to the form,
f.addCommand(exitCommand);
Set the command Listener to the form, should provide an action listener,
f.setCommandListener(myActionListener);