Originally Posted by
patrickdan02
The first one is from 0-3, the second up to the fourth one is 0-9.
I don't know how to create these choices using the For Loop. Please help me.
If the number of choice components is known/fixed and if the values are also known/fixed, there's no really need to use "loops".
Here is a simple example:
Integer[] evenValues = { 2, 4, 6, 8 }; // note: autoboxing since Java 5
JComboBox evenNumbersCombo = new JComboBox(evenValues);
Originally Posted by
patrickdan02
When you choose a number, it will display the corresponding words instead of numbers.
If you use JComboBox as I have described above, you have an Integer object as the "selected" value (not a primitive int).
How to generate a number in letters is another story. Every language, english, italian, etc... has its specific rules to form "literal numbers". And in general there are also many special/corner cases. You
have to known these rules.