SUGGESTED FIX
Name: ssR10077 Date: 02/26/2003
------- MChoicePeer.java -------
*** /tmp/dDWayKZ Wed Feb 26 13:41:13 2003
--- MChoicePeer.java Wed Feb 26 13:48:23 2003
***************
*** 82,91 ****
}
}
! void notifySelection(int index) {
Choice c = (Choice)target;
ItemEvent e = new ItemEvent(c, ItemEvent.ITEM_STATE_CHANGED,
! c.getItem(index), ItemEvent.SELECTED);
postEvent(e);
}
--- 82,91 ----
}
}
! void notifySelection(String item) {
Choice c = (Choice)target;
ItemEvent e = new ItemEvent(c, ItemEvent.ITEM_STATE_CHANGED,
! item, ItemEvent.SELECTED);
postEvent(e);
}
***************
*** 97,110 ****
inUpCall = false; /* Used to prevent native selection. */
MToolkit.executeOnEventHandlerThread(c, new Runnable() {
public void run() {
! if (c.getItemCount() == 0) {
! /* Nothing to do when the list is empty. */
! return;
! }
! inUpCall = true; /* Prevent native selection. */
! c.select(index); /* set value in target */
! notifySelection(index);
! inUpCall = false;
}
});
}
--- 97,114 ----
inUpCall = false; /* Used to prevent native selection. */
MToolkit.executeOnEventHandlerThread(c, new Runnable() {
public void run() {
! String item;
! synchronized(c) {
! if (index >= c.getItemCount()) {
! /* Nothing to do when the list is too short. */
! return;
! }
! inUpCall = true; /* Prevent native selection. */
! c.select(index); /* set value in target */
! item = c.getItem(index);
! inUpCall = false;
! }
! notifySelection(item);
}
});
}
###@###.### 2003-02-26
======================================================================
|