}
public void updateList(String name, boolean connect) throws RemoteException {
if (name != null) {
if (connect && !users.contains(name)) {
model.addElement(new JListClientItem(name, name, "chat/resources/person.png"));
users.add(name);
} else {
model.removeElementAt(users.indexOf(name));
users.remove(name);
}
return;
}
LinkedList<String> usersList = admin.getClientsList();
if (users != null) {
for (Iterator<String> it = usersList.iterator(); it.hasNext();) {
String nick = it.next();
if (!username.equals(nick) && !users.contains(nick)) {
model.addElement(new JListClientItem(nick, nick, "chat/resources/person.png"));
users.add(nick);
}
}
}
userList.setModel(model);