title: Java: How cursor automatically move from one TextField to other
body: <p>In my application four TextArea is there and I want to enter only four character in one Text area and cursor automatically move to next TestArea. Again when I enter four character in this TextArea then again cursor automatically move to next TextArea.</p>
  
  <p>Example: At the time of installing Window XP it want "Key" and there are four section when you enter four character in first section then cursor automatically move to the next section.</p>
  
  <p>Same thing I want in my application.</p>
  
  <p>For this first of all I add CustomizedTextFields.jar and then created four IntegerField:</p>
  
  <pre><code>private IntegerField text1;
  private IntegerField text2;
  private IntegerField text3;
  private IntegerField text4;
  </code></pre>
  
  <p>after this I show all these IntegerField on my frame.</p>
  
  <p>Now I tried this code to send cursor to the next field but it's not working:</p>
  
  <pre><code>text1.addKeyListener(new KeyListener() {
              @Override
              public void keyTyped(KeyEvent e) {
                      int a2 = text1.getText().length();
                      if (a2 == 3) {
                          text2.getCursor();
                      }
              }
  
              @Override
              public void keyReleased(KeyEvent e) {
              }
  
              @Override
              public void keyPressed(KeyEvent e) {
              }
          });
  </code></pre>