title: Adding Values to a ComboBox using a For loop
body: <p>I'm currently making a application that is meant to emulate a real life shop, right now when a customer makes a order it gives that order a unique order number. I have the option for each customer to be able to remove and edit orders. What I want is when the customer presses the remove/edit tab they are met with a drop down combo-box full with all the order numbers that have assigned.</p>
  
  <p>I first start off buy creating a list of integers that should have the same amount of ints as my other array list that gets filled with orders.</p>
  
  <pre><code>public int[] getOrderNumbersList() {
          int[] orderNumbersList = new int[basket.size()];
          for (int i = 0; i &lt; orderNumbersList.length; i++) {
              orderNumbersList[i] = basket.get(i).getOrderNumber();
          }
  
          return orderNumbersList;
      }
  };
  </code></pre>
  
  <p>The problem seems to be when I'm trying to add the numbers to the combo list, I'm struggling in how to separate each index of the integer list and add them one by one to the combo, </p>
  
  <pre><code>JComboBox comOrderNumber = new JComboBox ();
      for (int i = 0; i&lt;100; i++) {
          int p=0 ;
          sc.getOrderNumbersList();
          entOrderNumber.addItem("" + (orderNumbersList[p]));
          p++;
  }
  </code></pre>
  
  <p>How far I tried to get. Sorry if I've not been clear or that easy to understand. I'm still a beginner coder.</p>