File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

combobox problem

 
terry oliver
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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("");
}
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic