How to Check if all the JTexFields are empty or not?
<p>I am using a <strong>for loop</strong> to create 9  <strong>JTextFields</strong> and this is working fine. My problem is, I want to check of all the these <strong>JTextField</strong> is empty or not' at one time. I know there is a method like:</p>

<pre><code>if (textbox.getText().trim().equals(""))
</code></pre>

<p>to check if the JTextField is empty or not, But I am not sure if it is suitable for the method that I am using for <strong>JTextField</strong>. Below is my <strong>for loop:</strong></p>

<pre><code>       for (int index = 1; index &lt;=9; index++)
            {
                JTextField field = new JTextField(3);
                field.setPreferredSize(new Dimension(150, 50));
                field.setHorizontalAlignment(JTextField.CENTER);
                field.setEditable(false);
                second.add(field);
                second.add(Box.createHorizontalStrut(10));
                second.add(Box.createVerticalStrut(10));

            }   
</code></pre>
