title: How do I create a JComboBox loop so the same combobox will appear multiple times?
body: <p>Im trying to create a loop to create this JComboBox multiple times on the page. Any idea why this isnt working?</p>
  
  <pre><code>        String[] numbers = {"1","2","3","4","5","6","7","8","9","10"};
          JComboBox numberbox = new JComboBox(numbers); 
       for(int j = 1; j &lt;= 12; j++){
          numberbox[j].setLocation(103,j*30);
          numberbox[j].setSize(47,26);
          numberbox[j].setSelectedIndex(1);
          numberbox[j].setBackground(Color.WHITE);
          panelForTextFields.add(numberbox[j]);
          numberbox[j].addActionListener(this);
       }
  </code></pre>
  
  <p>I believe it is a working code other than the loop part. When I replace it with this chunk of code it does print a single JComboBox that works as I want.</p>
  
  <pre><code>        String[] numbers = {"1","2","3","4","5","6","7","8","9","10"};
          JComboBox numberbox = new JComboBox(numbers); 
          numberbox.setLocation(103,30);
          numberbox.setSize(47,26);
          numberbox.setSelectedIndex(1);
          numberbox.setBackground(Color.WHITE);
          panelForTextFields.add(numberbox);
          numberbox.addActionListener(this);
  </code></pre>
  
  <p>Error im recieving in eclipse is "The type of the expression must be an array type but it resolved to JComboBox"</p>