0

I am new to J2ME Programming so i am stuck with the keylisteners..

I am writing a simple J2ME app in which there are 2 textfields. As soon as the user types a char in first textfield the result must be displayed in second.

I want to handle the events of changes in data of TextField. Can any body tell what listener to use for it and how to do it ???

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Hakoo
0

As peter_budo told, use ItemStateListener(), and implement Abstract Method of it,

public void itemStateChanged(Item item)
{

}

Set this listener to your form. and then write following code :

public void itemStateChanged(Item item)
{
 if( item == txtFld1)
 {
       // Do something when State change of TextField1
 }
  if( item == txtFld2)
 {
       // Do something when State change of TextField2
 }
}

Hope, this will help you. If you have any questions regarding to this then ask.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.