I am very new to programming and can't seem to get past this hiccup. I would like to have a choicebox that is populated with options and that is present immediately. I have tried defining the ObservableList and then creating a ComboBox but it is empty when I actually run the code. I do not need to edit this array after it appears. Here is my code:
ObservableList<String> options =
FXCollections.observableArrayList(
"Option 1",
"Option 2",
"Option 3"
);
@FXML
final ComboBox stores = new ComboBox(options);
@FXML
private Label label;
I have created the combobox in the FXML document using Scene Builder with FXid stores.
Any help would be appreciated! Thanks in advance.