【发布时间】:2012-07-25 22:17:54
【问题描述】:
如何使用 FXML 在ComboBox 中设置默认值?
<ComboBox fx:id="cbo_Bacteriologie_Aesculine" prefHeight="21.0" prefWidth="105.0" GridPane.columnIndex="1" GridPane.rowIndex="0">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="NVT" />
<String fx:value="Bezig" />
<String fx:value="Positief" />
<String fx:value="Negatief" />
</FXCollections>
</items>
</ComboBox>
我希望默认选择NVT。我尝试添加 selected="selected" 等,但似乎找不到正确的语法。
是否可以使用 Scene Builder 编辑列出的项目?好像没找到。
【问题讨论】:
标签: java javafx combobox javafx-2 fxml