I have build a j2me app that sends the data to some device regularily like every 50ms.
I want it to respond to keypress on keypad of mobile phone and sent a particular data for each key! How to do that?
Thanks but i already had a look at this.
But i couldnt figure out actualy which interfaces need to be implemented? And whats the deal about "keyPress()" function? Does it come from Canvas class?
And is this function the one called when a key is Pressed?
Joined: Mar 26, 2010
Yes the Canvas class provides three callback method keyPress(), keyReleased() and keyRepeated(). As the name suggest they are called when you do something with the key. As far as I understand, the Board class need to implement CommandListener interface because it included a exit command. The must have method for CommandListener class is commandAction() method, So you need to exclusively define this method in the Board Class which extends Canvas class and implements the CommandListener Interface.