title: Accessing GUI JTextField objects that are dynamically generated
body: <p>I am writing a program that contains a <code>JButton</code>. Every time the button is clicked, a new <code>JTextField</code> is added to a <code>JPanel</code>.</p>
  
  <p>My problem is that, after the user has created all the <code>JTextFields</code> and filled them with information, I need to get the text of each field. How can I get access to the <code>JTextFields</code> when they are dynamically generated, as they don't have instance names? Is there a better way to get the text of each one, without knowing their instance name.</p>
  
  <p>Here is the code of the <code>actionPerformed</code> event of the <code>JButton</code>...</p>
  
  <pre><code>private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                         
      JTextField x = new JTextField();
      x.setColumns(12);
      p.add(x); 
      validate();
  }
  </code></pre>