Exemplo n.º 1
0
  /** the constructor */
  public PrivateClient(Client parent, ClientInterface selfIdentity) throws RemoteException {
    super(parent.getUserName() + " in private session with " + selfIdentity.getUserName());

    this.parent = parent;
    this.selfIdentity = selfIdentity;

    this.server = this.parent.getClassServer();

    this.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent ev) {
            selfRemove();
            ev.getWindow().dispose();
          }
        });

    initComponents();
    lineSeparator = System.getProperty("line.separator");
  }
Exemplo n.º 2
0
 /** Displays a new incomming private message. */
 public void displayPrivateMessage(ClientInterface from, String message) throws RemoteException {
   ta.append("<" + from.getUserName() + ">: " + message + lineSeparator);
   ta.setCaretPosition(ta.getText().length());
 }
Exemplo n.º 3
0
  /** The method tests if this object is equal to another. */
  public boolean equals(ClientInterface cli) throws RemoteException {
    if (selfIdentity.equals(cli)) return true;

    return false;
  }