Click to See Complete Forum and Search --> : drop down menu


The One
02-26-2006, 06:38 AM
i got this drop down menu made:
[code]
final JComboBox yearChoice = new JComboBox();
int months = 1950;
for (int i=0;i<months;i++);
yearChoice.addItem(months +1);

yearChoice.setSelectedItem(months);
...
How do i make it so that it creates an array of the years from 1950 t0 2000??? right now it is just adding 1950 to the drop down menu HELP?

vnc3nt
02-26-2006, 06:50 AM
for (i = 1499; i < 2001; i++) {
yearChoice.addItem(i);
}

The One
02-26-2006, 09:24 AM
ok iv done as u said below:
final JComboBox yearChoice = new JComboBox();

for (i = 1499; i < 2001; i++) {
yearChoice.addItem(i);


yearChoice.setSelectedItem();
}

Is there something missing or wrong cos it says cannot find variable symbol i???

The One
02-26-2006, 09:29 AM
it ok i got it fixed. just had to say that i = 1499.