public void updateClientList(ArrayList<ClientInfo> clients) { for (int i = 0; i < clients.size(); i++) { ClientInfo ci = clients.get(i); if (ci.getName().equals(name)) { view.setName(name + " - (" + ci.getPoints() + ")"); break; } } view.setClientList(clients); }
// Constructor to initialize client name and server location public C_GameClient(String name, String serverLoc) throws RemoteException, MalformedURLException, NotBoundException { model = new M_GameClient(name, this); Naming.rebind("client", model); this.name = name; SERVER_STUB_LOC = serverLoc; setSize(400, 400); setVisible(true); setTitle("Game Client - " + this.name); addWindowListener(this); view = new V_GameClient(); view.setName(name); view.setMouseListener(gameMouseListener); add(view); model.login(name, model); state = STATE.CONNECTED; }