@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == button_send) { control.send_message(textField.getText()); textField.setText(""); textField.requestFocus(); } }
@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(); } }