title: When sending message with keylistener "enter" why do I get and extra linebreak?
body: <p><a href="https://github.com/AEkman/QuizApplication/blob/master/src/ClientController.java" rel="nofollow noreferrer">github link</a></p>
  
  <p>When pressing enter I want to send message via event using FXML:</p>
  
  <pre><code>textFieldInput.setOnKeyPressed(keyEvent -&gt; {
      try {
          if (keyEvent.getCode() == KeyCode.ENTER)  {
                  String text = textFieldInput.getText();
                  send(text);
          }
      } catch (Exception exception) {
          textFieldInput.setText("message not sent! -something went wrong... \n");
      }
  });
  </code></pre>
  
  <p>Send function:</p>
  
  <pre><code>public void send(String message) {
      try {
          output.println(ClientController.USERNAME + ": " + message);
          output.flush();
          textFieldInput.clear();
      } catch (Exception exception) {
          output.println("message not sent! -something went wrong... \n");
      }
  }
  </code></pre>
  
  <p>My problem is that after i send a message the program adds another "keystroke" so my return key gets hit again and adds a new line to the textField area. I don't see why and where?</p>