I currently have a shopping cart that records how many orders have been made by using a :
int orderNumber
and just ++
when ever a new order is made, I want to add a edit function where someone will click on a edit button and it will open a new frame where they will select what order they want to edit via a combobox, the problem is that I need the comboBox to fill with 1,2,3 etc... Depending on how many orders were made. I had a go at achieving this with the method below however it only errors.
orderNumbersList = new String[orderNumber];
for (int i = 1; i <= orderNumber; i++) {
orderNumbersList[i] = "" + i;
}
JComboBox orderNumberBox = new JComboBox(orderNumbersList);