title: Image is displayed on top of a MenuBar
body: <p>Dears,</p>
  
  <p>I am trying to do an application using JavaFX. But for some reason, when I am trying to move an image, it is displayed on top of a MenuBar but behind the other panes. And of course, I would like to avoid that.</p>
  
  <p>(Sorry, no image because I do not have enough reputation...)</p>
  
  <p>I have already tryed to group then and to call the toFront() method but it is worst and change everything.</p>
  
  <p>Here is my fxml</p>
  
  <pre><code>&lt;MenuBar&gt;
          &lt;menus&gt;
              &lt;Menu text="File"&gt;
                  &lt;items&gt;
                      &lt;MenuItem text="Save"/&gt;
                      &lt;SeparatorMenuItem /&gt;
                      &lt;MenuItem text="Return"/&gt;
                      &lt;MenuItem text="Quit"/&gt;
                  &lt;/items&gt;
              &lt;/Menu&gt;
          &lt;/menus&gt;
      &lt;/MenuBar&gt;
  
      &lt;VBox&gt;
          &lt;Pane fx:id="imagePane"/&gt;
          &lt;HBox fx:id="buttonsPane" styleClass="white"&gt;
              &lt;Button text="B1" prefHeight="50" prefWidth="50"/&gt;
              &lt;Button text="B2" prefHeight="50" prefWidth="50"/&gt;
          &lt;/HBox&gt;
      &lt;/VBox&gt;
  </code></pre>
  
  <p>Here is my controller</p>
  
  <pre><code>public void enter(Scene scene) {
          Image image = new Image("images/square.png");
          ImageView background = new ImageView(image);
          imagePane.getChildren().add(background);
          background.setTranslateX(20);
          background.setTranslateY(20);
  
          scene.getRoot().addEventFilter(MouseEvent.MOUSE_PRESSED, mev -&gt; {
              int y = 0;
              switch(mev.getButton()) {
              case PRIMARY:
                  y = (int) background.getTranslateY();
                  background.setTranslateY(y - 6);
                  break;
              case SECONDARY:
                  y = (int) background.getTranslateY();
                  background.setTranslateY(y + 43);
                  break;
              default:
                  break;
              }
          });
      }
  </code></pre>