Name

ItemStateListener

Synopsis

An interface implemented by objects that want to be notified when the state of an Item is changed as the result of user action. Each Form can have a single ItemStateListener that is registered by calling its setItemStateListener() method. Programmatic changes to the state of an Item are never notified to the ItemStateListener.

The ItemStateListener’s itemStateChanged() method is called when the user makes a notifiable change in the state of any Items on the Form. The circumstances that result in notification depend on the nature of the Item. A text field, for example, will typically not notify every character entered or deleted, but will delay notification until the user moves the input focus elsewhere. A ChoiceGroup, on the other hand, will notify the Form’s ItemStateListener whenever the user changes its selection state.

public interface ItemStateListener {  
// Public Instance Methods
   public abstract void itemStateChanged( Item item);  
}

Passed To

Form.setItemStateListener()

Get J2ME in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.