EventHandling - Commands
Implements CommandListener
- public class HelloWorldMidlet extends MIDlet implements CommandListener
Create a Command Object
- private Command cmExit;
- cmExit = new Command(„Exit“, Command.SCREEN, 1);
Add the Command Object to displayable
- fmMain.addCommand(cmExit);
Add a CommandListener to displayable
- fmMain.setCommandListener(this);
public void commandAction(Command c, Displayable s)
if(c == cmExit) {doSomething;}