First, the months are displayed twice because of this:
The combobox is created with a string[] parameter of values.
Code:
inputMonth = new JComboBox(months);
Then more values are put in the list (duplicating the entries).
Code:
for (int i = 0; i < 12; i++)
{
inputMonth.addItem(months[i]);
}
JComboBox has one constructor like this:
Code:
JComboBox(Object[] items)
Creates a JComboBox that contains the elements in the specified array
So you can either do this:
Code:
inputMonth = new JComboBox(); // No parameter
for (int i = 0; i < 12; i++) // Fill in values
{
inputMonth.addItem(months[i]);
}
or simply this, as you have done and lose the for loop:
Code:
inputMonth = new JComboBox(months);
I'll look at the rest if I get time
