title: JavaFX button doesnt do anything
body: <p>I am beginner to javafx, I am trying to make a menu and when someone click on menuitem it will print out text
  I have these codes</p>
  
  <pre><code>package sam;
  
  import javafx.application.Application;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.stage.Stage;
  
  /**
   *
   * @author devby
   */
  public class SaM extends Application {
  
  @Override
  public void start(Stage stage) throws Exception {
      Parent root = FXMLLoader.load(getClass().getResource("home.fxml"));
  
      Scene scene = new Scene(root);
  
      stage.setScene(scene);
      stage.show();
  }
  
  /**
   * @param args the command line arguments
   */
  public static void main(String[] args) {
      launch(args);
  }
  
  }
  </code></pre>
  
  <p>My controller looks like this</p>
  
  <pre><code>package sam;
  import java.net.URL;
  import java.util.ResourceBundle;
  import javafx.event.ActionEvent;
  
  import javafx.fxml.FXML;
  import javafx.fxml.Initializable;
  
  /**
   *
   * @author devby
   */
  public class homeController implements Initializable {
      @Override
      public void initialize(URL location, ResourceBundle resources) {
          //TODO
      }
  
      @FXML
      public void callHome(ActionEvent event) {
          System.out.println("Clicked on menu Home");
      }
  
  }
  </code></pre>
  
  <p>And my fxml file looks like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import javafx.scene.Cursor?&gt;
  &lt;?import javafx.scene.control.Menu?&gt;
  &lt;?import javafx.scene.control.MenuBar?&gt;
  &lt;?import javafx.scene.control.MenuItem?&gt;
  &lt;?import javafx.scene.layout.AnchorPane?&gt;
  
  &lt;AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="401.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sam.homeController"&gt;
     &lt;children&gt;
        &lt;MenuBar layoutY="2.0" prefHeight="26.0" prefWidth="600.0" AnchorPane.bottomAnchor="372.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="2.0"&gt;
          &lt;menus&gt;
            &lt;Menu mnemonicParsing="false" onAction="#callHome" text="Home" /&gt;
            &lt;Menu mnemonicParsing="false" text="Library"&gt;
              &lt;items&gt;
                &lt;MenuItem mnemonicParsing="false" text="Movies" /&gt;
                    &lt;MenuItem mnemonicParsing="false" text="Serials" /&gt;
              &lt;/items&gt;
            &lt;/Menu&gt;
            &lt;Menu mnemonicParsing="false" text="Online" /&gt;
              &lt;Menu mnemonicParsing="false" text="Download" /&gt;
              &lt;Menu mnemonicParsing="false" text="Settings" /&gt;
          &lt;/menus&gt;
        &lt;/MenuBar&gt;
     &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>
  
  <p>When I run the program and click on Home menu button it does nothing.
  I am using javafx 8, IDE is netbeans and I am building GUI with Scene Builder
  Can anyone help ?</p>
  
  <hr>
  
  <p>News:
  I have added a button and tried him. It works so probably something wrong with a menu</p>