title: Java Clearing Components in JPanel Issue
body: <p>I'm trying to clear everything in my JPanel in an easier way than hard coding it all. I have a for loop which works great for JTextFields but nothing else. The commented out block makes everything work but I wanted to see if I could add the JPanels contained within on the fly as well. </p>
  
  <pre><code>List&lt;Component&gt; controls = new ArrayList&lt;&gt;();
  controls.addAll(Arrays.asList(this.getComponents()));
  /*controls.addAll(Arrays.asList(jPanel1.getComponents()));
  controls.addAll(Arrays.asList(jPanel2.getComponents()));
  controls.addAll(Arrays.asList(jPanel3.getComponents()));
  controls.addAll(Arrays.asList(jPanel4.getComponents()));
  controls.addAll(Arrays.asList(jPanel5.getComponents()));
  controls.addAll(Arrays.asList(jPanel6.getComponents()));
  controls.addAll(Arrays.asList(jPanel7.getComponents()));
  controls.addAll(Arrays.asList(jPanel8.getComponents()));
  controls.addAll(Arrays.asList(jPanel9.getComponents()));
  controls.addAll(Arrays.asList(jPanel10.getComponents()));
  controls.addAll(Arrays.asList(jPanel11.getComponents()));
  controls.addAll(Arrays.asList(jPanel12.getComponents()));
  controls.addAll(Arrays.asList(jPanel13.getComponents()));*/
  for(Component control : controls) {
      if(control instanceof JTextField) {
          System.out.println(control.toString());
          JTextField ctrl = (JTextField) control;
          ctrl.setText("");
      } else if (control instanceof JList) {
          System.out.println(control.toString());
          JList list = (JList) control;
          for (int i = 0; i &lt; list.getModel().getSize(); i++) {
              list.remove(i);
          }
      } else if (control instanceof JTable) {
          System.out.println(control.toString());
          JTable table = (JTable) control;
          for (int i=0;i &lt; table.getRowCount();i++) {
              table.getModel().setValueAt("", i, 0);
          }
          for (int i=0;i &lt; table.getColumnCount();i++) {
              table.getModel().setValueAt("", 0, i);
          }
      } else if (control instanceof JRadioButton) {
          System.out.println(control.toString());
          JRadioButton radio = (JRadioButton) control;
          radio.setSelected(false);
      } else if (control instanceof JPanel) {
          JPanel panel = (JPanel) control;
          controls.addAll(Arrays.asList(panel.getComponents()));
      }
  }
  </code></pre>