I have a JComboBox with numbers like:
JComboBox test;
String[] a = new String[5];
for (int i = 0; i < 5; i++) {
a[i]=i+1 + "";
}
test = new JComboBox(a);
Now I want to spawn the number selected of JComboBoxes:
test.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String player =test.getSelectedItem();
//Insert code here to create a variable number of Combo Boxes
}
});
The code looks messy. This is not what I am trying to do but it's a huge help for what I want.
Ignore the fact that numbers are as String within the code a parseInteger would do.
Thanks in advance.