Exemple #1
0
  @Override
  public void actionPerformed(ActionEvent e) {

    if (e.getSource() == button_send) {
      control.send_message(textField.getText());
      textField.setText("");
      textField.requestFocus();
    }
  }
Exemple #2
0
 @Override
 public void keyPressed(KeyEvent key) {
   // TODO Auto-generated method stub
   if (key.getKeyCode() == KeyEvent.VK_ENTER) {
     control.send_message(textField.getText());
     textField.setText("");
     textField.requestFocus();
   }
 }