title: How to move the text pointer from one field to another in java
body: <p>Iam using javafx to implement a calculator ... my calculator's design should be from Hewlett-Packard from seventies .. I have two text fields , in each text field I insert a number ... When I put a number in first text field so should I press ENTER in my calculator to move the text pointer to next text field to put anther number in it ... The problem that I do not know how to move the text pointer to the next text field when I press ENTER ... Here is my code for button Enter :</p>
  
  <pre><code>TextField text1 = new TextField();
  TextField text2 = new TextField();
  Button Enter = new Button("ENTER");
  Enter.setLayoutX(140);
  Enter.setLayoutY(270);
  Robot robot = new Robot();
  
  
      Enter.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
  
          @Override
          public void handle(ActionEvent event) {
  
  
              if (event.getSource() == Enter) {
                  robot.mouseMove(250,150); // (250,150) is the position of the second text field
              }
          }
  
      });
  </code></pre>
  
  <p>The problem with this code that when I press ENTER then my mouse pointer moves to<br>
  (250,150) but not my text pointer ...
  How to move the text pointer instead of mouse pointer?
  thank you</p>
  
  <p>EDIT :</p>
  
  <pre><code>TextField text1 = new TextField();
  TextField text2 = new TextField();
  TextField text3 = new TextField();
  Button Enter = new Button("ENTER");
  Enter.setLayoutX(140);
  Enter.setLayoutY(270);
  
  
      Enter.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
  
          @Override
          public void handle(ActionEvent event) {
  
  
              if (event.getSource() == Enter) {
                  if (!text1.requestFocus() || text2.requestFocus()) {
                  text3.requestFocus();
                } 
              }
          }
  
      });
  </code></pre>