random question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • carlos123
    New Member
    • Sep 2007
    • 53

    random question

    Code:
      public class MyActionListener implements ActionListener
         {
            public void actionPerformed(ActionEvent evt)
            {
                JComboBox yearcombo = (JComboBox)evt.getSource();
        
                // Get the new item
                Object stateselect = yearcombo.getSelectedItem();
                
            }
    }


    why doesnt this code work, it says it cant find "evt"
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by carlos123
    Code:
      public class MyActionListener implements ActionListener
         {
            public void actionPerformed(ActionEvent evt)
            {
                JComboBox yearcombo = (JComboBox)evt.getSource();
        
                // Get the new item
                Object stateselect = yearcombo.getSelectedItem();
                
            }
    }


    why doesnt this code work, it says it cant find "evt"
    Is that the exact error message you got? Please post the exact error message that you got. Also make sure you include all the necesasary import statements

    Comment

    Working...