j2me: How to use setCommandListener on a TextField?

Posted by SmRndGuy on Stack Overflow See other posts from Stack Overflow or by SmRndGuy
Published on 2012-12-16T23:51:04Z Indexed on 2012/12/18 11:03 UTC
Read the original article Hit count: 128

Filed under:
|
|

I wanted to make it so that when I select a specific TextField in a Form, I get a specific list of Commands,

for example
TextField: OK, Cancel
TextField2: OK, Back, Help

And I succeeded by using addCommand() on each of TextFields but I can't tell it what to happen when when I activate one of these commands since there is no setCommandListener method for them. It throws a NullPointerException when I click it.

I also tried to get the commands from their Form but it is receiving only the commands that it contains, not the commands that TextFields have

Any help how to get arround this? Thanks in advance

© Stack Overflow or respective owner

Related posts about java-me

Related posts about command