combo box event handlers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jon

    combo box event handlers

    I'm trying to write code which accepts a choice from a combo box, but no
    action is done until a button is pressed. The code that I have tried is
    below, it executes, but no action happens when I press the button.

    String choice = (String)((JComb oBox)source).ge tSelectedItem() ;
    if(choice=="Nam e of item")
    {
    //execute code
    }

    I have a feeling that it is because I am using
    source twice, but again, I am not aware of any methods that I can use.
    Thanks.



Working...