Stefan Toth wrote:
> 
> I have a list and I want to perform something when a
> list item is selected.
> The problem is that I cannot use action(Event,Object) because is get
> called only when I double click on the selected item.
> 

You can use the old-style event handling with the method "handleEvent"
for
all events generated by all the components.

// Sample
public boolean handleEvent(Event e) {
   switch (e.id) {
      // Double-clicking on a list generates an action event.
      // But list selection and deselection are separate event types.
      case Event.LIST_SELECT:
         System.out.println("You selected:
"+list.getItem(((Integer)e.arg).intValue()));
         break;
      case Event.LIST_DESELECT:
         System.out.println("You deselected:
"+list.getItem(((Integer)e.arg).intValue()));
         break;
   }
}

Reply via email to