ComboBox values do not appear for selection

1

I would like help from you in the following question !! I have a combobox and I want to populate it with integers. It turns out that when I run the program nothing appears for me to select! ... Here is the code:

 ObservableList<Integer> options
            = FXCollections.observableArrayList(1, 2, 3);
 comboboxQuantCam.setItems(options);
    
asked by anonymous 29.05.2015 / 19:22

1 answer

1

Your code is right except the object that was not built:

ComboBox comboboxQuantCam = new ComboBox ();

It would look like this:

     ObservableList<Integer> options

        = FXCollections.observableArrayList(1, 2, 3);

     ComboBox comboboxQuantCam = new ComboBox();

     comboboxQuantCam.setItems(options);

    seuLayout.getChildren().addAll(comboboxQuantCam);
    
29.05.2015 / 20:34