Want to set default value selected in JComboBox populated by enum

Viewed 35069

Below statement in if condition is not working, please provide me some solution that how to set selected item for JComboBox which are populated by ENUM.

      public enum EbayContryEnum 
        {
        AT    (3),
        AU    (4),
        BE    (5),
        CA    (7),
        CH    (14),
        DE    (11),
        ES    (13),
        FR    (10),
        IE    (2),
        IT    (12),
        NL    (16),
        UK    (15),
        US    (1);
        }

for ex:-

if(country.equals("FR"))
                      {
                      cbImportCountry.setSelectedItem("FR");
                      }

But it's not working..

3 Answers
Related