This fills my sample with five predefined bit rates. I assume that if you try to add items from your controller, the list will only show these values ββ(unchecked).
<ChoiceBox fx:id="baudRates" layoutX="234.0" layoutY="72.0"> <items> <FXCollections fx:factory="observableArrayList"> <String fx:value="4800" /> <String fx:value="9600" /> <String fx:value="19200" /> <String fx:value="57600" /> <String fx:value="115200" /> </FXCollections> </items> </ChoiceBox>
You also need to include the following import operation in your FXML:
<?import javafx.collections.*?>
source share