title: Is there more than one caret in JavaFX TextField?
body: <p>I'm currently getting in touch with JavaFx. As a starter, I try to write a small calculator. </p>
  
  <p>This calculator contains a TextField showing the expression to be calculated. I am able to put text in there via keyboard or via the buttons of the calculator. Clicking into the TextField with the mouse or navigating via keyboard results in a blinking caret at the right position as expected. But this caret is obviously not backed by the caret property of the TextField, as <code>textField.getCaretPosition();</code> returns 0 no matter were the blinking "mouse/keyboard-caret" shows up. Moving the "intern" caret with <code>textField.forward()</code> or <code>textField.backward()</code> etc. works just fine. </p>
  
  <p>Is there another property for the "mouse/keyboard-caret"? Please don't tell me I have to listen for mouseclicks and set the caret by myself. The same problem seems to occour for selections, <code>textField.getSelection()</code> returns (0,0), although text is selected(which means, it's blue). </p>
  
  <p>Here's what I'm trying to do in my controller-class. textField.getText() works fine, so the TextField itself should not be the problem.</p>
  
  <pre><code>@FXML
  private void onNumberButtonClicked(ActionEvent event){
      String formerText = textField.getText();
      int pos = textField.getCaretPosition(); //always returns 0, no matter were the cursor is
      String additionalText = ((Button)event.getSource()).getText();
      textField.setText(formerText.substring(0, pos) + 
      additionalText + 
      formerText.substring(pos));
  }
  </code></pre>
  
  <p>Thank you for your help!</p>