Zone de sélection Combo-Box dans JavaFX 2

J'ai un combo en javaFX qui est rempli avec des pays.

Mon objet:

public static class CountryObj {

    private  String TCountryDescr;
    private  String TCountryCode;        

    private CountryObj(String CountryDescr,String CountryCode) {
        this.TCountryDescr = CountryDescr;         
        this.TCountryCode = CountryCode;             
    }  
    public String getTCountryCode() {
        return TCountryCode;
    }
    public void setTCountryCode(String fComp) {
        TCountryCode= fComp;
    }         
    public String getTCountryDescr() {
        return TCountryDescr;
    }
    public void setCountryDescr(String fdescr) {
        TCountryDescr = fdescr;
    }                 
    @Override
    public String toString() {
        return TCountryDescr;
    }

}    

Puis j'ai ma observables liste:

private final ObservableList<CountryObj> CountrycomboList =
    FXCollections.observableArrayList(
                 new CountryObj ("United States", "US"),
                 new CountryObj ("United Kingdom", "UK"),
                 new CountryObj ("France", "FR"),
                 new CountryObj ("Germany", "DE"));    

Puis mon combo. Que le nom du pays est visible et je peux avoir le code du pays pour mon propre usage:

private ComboBox<CountryObj> cCountry1 = new ComboBox<>();

cbCountry1.setItems(CountrycomboList);

cbCountry1.getSelectionModel().selectedItemProperty().addListener(new                  ChangeListener<CountryObj>() {

        @Override
        public void changed(ObservableValue<? extends CountryObj> arg0, CountryObj arg1, CountryObj arg2) {
            if (arg2 != null) {
                System.out.println("Selected Country: " + arg2.getTCountryCode());
            }
        }
    });

Comment puis-je auto-sélectionnez par exemple l'Allemagne. Si je sais que le code du pays? "DE"

source d'informationauteur Elias Elias