title: Issue with Component Iteration and validation
body: <p>Am having a method that check all <code>JTextField</code>s in a panel <code>JPanel</code> to see whether they are empty, am iterating through all the components in the container. in the container i have labels, text fields and combo boxes. So i can be able validate the first few <code>JTextField</code>s but when i encounter the first <code>JComboBox&lt;?&gt;</code> the validation stop and i don't seem to understand why. Below is the code :-</p>
  
  <pre><code>private boolean validateInputFields(JPanel container) {
      for (Component comp : container.getComponents()) {
  
          if (comp instanceof JTextField) {
              JTextField temp = (JTextField) comp;
              if (temp.getText().trim().equals("")) {
                  changeComponentProperties(temp);
                  return true;
              } else{
                  temp.setBackground(Color.WHITE);
                  temp.setForeground(Color.BLACK);
              }
          }
      }
  
      return false;
  }
  </code></pre>
  
  <p>Any assistance will be highly appreciated.</p>
  
  <p>Also note that this is invoked when a button (say save button) is clicked.</p>