two combo box listeners
i have two combo boxes and a text box.
combobox A has a listener and decides the contents of the combo box B. Combo Box B has a listener
and has an action to set the text box based on the selected item.
When i just have the listener on the combo box A everything works fine. but i throw in the listener for
combo box B, the action gets messed up for combo box A where i see empty dropdowns in B the first time and then
it corrects itself
A = new SteppedComboBox(PTerms)
B = new SteppedComboBox(GTerms)
C = new JTextArea();
A.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
{
Object o = e.getSource();
if (o == A)
{
try
{
B.removeAllItems();
List GTerms = getGTerms();
Iterator GTermsListIter = GTerms.iterator();
while(GTermsListIter.hasNext())
{
B.addItem((String)GTermsListIter.next());
B.setVisible(true);
}
}
catch(Exception ex)
{
}
}
}
}
});
B.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
{
Object obj = evt.getSource();
if (obj == B)
{
try
{
String Description = getDesc();
C.setText(Description);
}
catch(Exception ex)
{
}
}
}
}
});
Any help would be great...

