public void actionPerformed(ActionEvent e) {
    Object s = e.getSource();
    if (s instanceof JButton && (JButton)s == clearButton) {
      current = "";
      textArea.setText(current);
    } else if (s instanceof JButton && (JButton)s == sendButton) {
      current = textArea.getText();
      cc.writeClientCutText(current, current.length());
      endDialog();
    } else if (s instanceof JButton && (JButton)s == cancelButton) {
      endDialog();
    }
  }