title: How to use setText() in a loop for increment JTextField names
body: <p>I'm new to Java. In my program, I have got 20 JTextFields named "textField0", "textField1", "textField2", "textField3", ... like wise up to 20. I need to set texts for all those 20 fields in a loop like this.. </p>
  
  <p>Ex;</p>
  
  <pre><code>    textField0 = new JTextField();
      textField1 = new JTextField();
      textField2 = new JTextField();
      textField3 = new JTextField();
  
      String names[] = {"Sample text 1", "Sample text 2", "Sample text 3", "Sample text 4"};
  
      for (int i=0; i&lt;4; i++) {
          textField[i].setText(names[i]);
      }
  </code></pre>
  
  <p>I have tried for several days and tried everything I know but no solution. I'm sorry if this is not possible with Java. Thank you.  </p>