hi my j2me client contains twoi textfields. in which the user has to enter two strings. there is a menu whichs help the user to complete any of the two strings. so that when the user presses the ok button, the select text enters the textfield the the user was using when he pressed the help menu. how do i get to know which of the two textfields had the focus, when the menu was clicked.
One way is to keep track of the field they are in with an instance vairable. So when you enter the field, you set that variable to some constant, then when you enter the other field you set it to another constant, then when the Command is clicked, then look at that instance variable to see the last field that they were in.
if(temp.equals (c1)) {which=2; } } } this code works only when the user edits the first or the second field, this event id not fired by moving the key between the two textfields. how can this be done. is there no FocusListener
No there isn't a FocusListener. Remember they need to keep the amount of classes down to a minimun, so they figure the ItemStateListener is enough to cover all somthing or other.