title: How do you get the SimpleMenuButton to display the MenuItem text in JavaFX?
body: <p>I am building an inventory management system for work and am having a lot of trouble getting the SplitMenuButton to display the MenuItem when I click on the item. I can not find much information on the 'SplitMenuButton' on the internet and have tried just MenuButton as well with no luck. For example, the default text is 'Department' and I would like it to display 'Aseptic' when that menu item is selected or 'Facilities' when that menu item is selected.</p>
  
  <p>I have tried to create a new instance of SplitMenuButton and setText("Aseptic") when the #buildDataAseptic method is run, but this still didn't work.</p>
  
  <p>My fxml code is:</p>
  
  <pre><code>&lt;SplitMenuButton mnemonicParsing="false" prefHeight="25.0" prefWidth="217.0" text="Department" textAlignment="CENTER"&gt;
                  &lt;items&gt;
                    &lt;MenuItem fx:id="asepticMenuItem" mnemonicParsing="false" onAction="#buildDataAseptic" text="Aseptic" /&gt;
                    &lt;MenuItem fx:id="generalMenuItem" mnemonicParsing="false" onAction="#buildDataGeneral" text="General" /&gt;
                      &lt;MenuItem fx:id="facilitiesMenuItem" mnemonicParsing="false" onAction="#buildDataFacilities" text="Facilities" /&gt;
                  &lt;/items&gt;
                &lt;/SplitMenuButton&gt;
  </code></pre>
  
  <p>any help is greatly appreacitead, thanks!</p>