| Author |
combobox problem
|
terry oliver
Greenhorn
Joined: Jan 04, 2008
Posts: 22
|
|
I am using the combobox to display some array items my problem is it does not automatically display the first array items i have to display items 2 and then return to 1 for the display. private void secData_actionPerformed(ActionEvent e) { String o = (String)secData.getSelectedItem(); Integer choice = Integer.parseInt(o); for (int x = 0; x < secTurnsTemp.size(); x++) { if (choice.intValue() == x+1) { secTurns1.setText(((Double)secTurnsTemp.get(x)).toString()); wireSize1.setText(((Double)secGaTemp.get(x)).toString()); secOhm1.setText(String.format("%6.3f",((secOhmsTemp.get(x))))); cmPerAmp1.setText(((Double)secCmTemp.get(x)).toString()); } else if (choice.intValue() > secTurnsTemp.size()) { secTurns1.setText(""); wireSize1.setText(""); cmPerAmp1.setText(""); secOhm1.setText(""); } }
|
 |
 |
|
|
subject: combobox problem
|
|
|