#getOccupants question

What is the best practice for using #getOccupants?

MultiUserChat muc = new MultiUserChat(myChat.getConnection(),“test@conference.om23586”);

muc.join(“jon”, “”);

Iterator i = muc.getOccupants();

while(i.hasNext()){

System.out.println("occupant name " + i.next());

}

I join the room and want to get the occupants, but #getOccupants does not return anything back.

Adding Thread.sleep(500) and then #getOccupants, seems to work.

Is there a better way?

Thanks.

i use the #joined() in the ParticipantStatusListener, just make sure you add the listener before you join.