// because it is called from the Window Thread. It is sufficient to
// synchronize the code that manipulates 'selected' except for the
// case where the peer changes. To handle this case, we simply
// repeat the selection process.
ListPeer peer;
do {
peer = (ListPeer)this.peer;
if (peer != null) {
peer.select(index);
return;
}
synchronized(this)
{