public void actionPerformed(final ActionEvent e)
  {
    if (e.getActionCommand().equals("join"))
    {
      this.nickname = typedText.getText();
      this.join.setEnabled(false);
      typedText.setText("");
      typedText.requestFocusInWindow();

      if (this.client.join(this.nickname))
      {
        this.open = true;

        this.send.setEnabled(true);
        this.leave.setEnabled(true);
      }
      else
      {
        this.join.setEnabled(true);
      }
    }
    else if (e.getActionCommand().equals("send"))
    {
      this.client.send(this.nickname, typedText.getText());

      typedText.setText("");
      typedText.requestFocusInWindow();
    }
    else if (e.getActionCommand().equals("leave"))
    {
      this.client.leave(nickname);

      this.join.setEnabled(false);
      this.send.setEnabled(false);
      this.leave.setEnabled(false);

      this.open = false;

      System.exit(0);
    }
  }