In J2ME there is the interface ItemStateListener which can detect exactly the item which is being changed. Is there a similar way in LWUIT ? I tried using the DataChangedListener interface but it gives the character position within the TextField , or -1 , for the index argument ! So ….
In J2ME there is the interface ItemStateListener which can detect exactly the item which
Share
Initially set the
booleanvalue to false and add the listener for the components then if any event occurs on that components, set the boolean value to true. Use theaddDataChangeListener(It only forTextField) oraddActionListenerfor the components. OnaddDataChangeListenerreturns two index values. Initially returns -1 and then returns current text position of theTextField. AFAIK OnTextField, they set the default index value is -1 forfireDataChangedonsetTextmethod. That is why it will returns -1 initially.