示例#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");
  }
示例#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());
 }