예제 #1
0
 // ---------------------------------------------------- Surcharges methodes publiques
 @Override
 public AbstractClient addClient(String username, String hostIP, int port, ViewClient view) {
   ChatClientRMI c = new ChatClientRMI(username);
   setClient(c);
   client.addObserver(view);
   RemotableChatClientItf remoteClientInterface;
   try {
     remoteClientInterface = (RemotableChatClientItf) UnicastRemoteObject.exportObject(client, 0);
     client.join(hostIP, port);
     view.getConnectionButton().setEnabled(false);
   } catch (RemoteException e) {
     System.out.println("RMIClientControler addClient error : " + e);
     e.printStackTrace();
   }
   return client;
 }
예제 #2
0
 @Override
 public void initEnable(ViewClient view) {
   view.getHostField().setEnabled(false);
   view.getPortField().setEnabled(false);
   view.setTitle("RMI chat");
 }