MenuButton doesn't display items in Javafx
I have a class Foo which just load the FXML and create the scene. In the FXML, I set the controller to be FooController ( fx:controller="FooController" ) And I add a MenuButton: <MenuButton fx:id="menuButton" layoutX="264.1875" layoutY="146.5" mnemonicParsing="false" text="MenuButton" /> And I try to set the menuButton in the FooController: public class FooController implements Initializable{ @FXML final MenuButton menuButton = new MenuButton("Modalities"); @Override public void initialize(URL arg0, ResourceBundle arg1) { final ObservableList<CheckMenuItem> listFilter = FXCollections