我有以下FXML:
<ChoiceBox>
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="2 minutes" />
<String fx:value="5 minutes" />
<String fx:value="15 minutes" />
</FXCollections>
</items>
</ChoiceBox>
Run Code Online (Sandbox Code Playgroud)
但是在GUI中它只显示一个默认为nothing的ChoiceBox.我希望列表中的第一个元素是默认值,并且选择"null"或者不禁止任何内容.
我该如何做到这一点?