【发布时间】:2017-04-28 07:25:18
【问题描述】:
public void start(final Stage frame) throws Exception {
String[] locales = Locale.getISOCountries();
for (String countrylist : locales) {
Locale obj = new Locale("", countrylist);
String[] city = {obj.getDisplayCountry()};
for (int x = 0; x < city.length; x++) {
cities = FXCollections.observableArrayList(obj.getDisplayCountry());
country = new ComboBox<String>(cities);
}
}
}
我想使用 Locale 类显示国家/地区列表。但是,当我运行代码时,我只能在 Combobox 中显示一个国家/地区。我不确定我是否弄错了循环或什么。
【问题讨论】:
-
让我格式化你的代码。