if (m instanceof GamesMessage) {
this.setGameList((GamesMessage) m);
this.setPlayerCountLabel();
}
if (m instanceof PlayersMessage) {
PlayersMessage pm = (PlayersMessage) m;
int size = this.playerlist.getModel().getSize();
ArrayList<String> alist = new ArrayList<String>();
for (int i = 0; i < size; i++) {
alist.add((String) playerlist.getModel().getElementAt(i));
}
ArrayList<String> newPlayers = new ArrayList<String>();
Enumeration<String> e = pm.getPlayerNames().keys();
while (e.hasMoreElements()) {
String nick = (String) e.nextElement().toString();
nick += " [" + (String) pm.getPlayerNames().get(nick).toString() + "]";
newPlayers.add(nick);
}
// int newSize = newPlayers.size();
// if (size > newSize && size - newSize == 1) {
// for (int j = 0; j < size; j++) {