title: adding context menu to pane in javafx
body: <p>i'am trying to make context menu that will show when i click right mouse click <br>
  but it's look like i just can add the context menu to the controls only <br>
  here is me code</p>
  <pre><code>MenuItem copy = new MenuItem(&quot;Copy&quot;);
  MenuItem paste = new MenuItem(&quot;Paste&quot;);
  MenuItem cut = new MenuItem(&quot;Cut&quot;);
                  
  edit.getItems().addAll(copy,paste,cut);
                  
  ContextMenu contextMenu = new ContextMenu();
                  
  contextMenu.getItems().addAll(copy,cut,paste);
                  
  pane.setContextMenu(contextMenu);
  
  pane.addEventHandler(MouseEvent.MOUSE_PRESSED, event -&gt; {
      if (event.isSecondaryButtonDown()) {
          System.out.println(&quot;asasasa&quot;);
          contextMenu.show(pane, event.getScreenX(), event.getScreenY());
      } else {
          contextMenu.hide();
      }
  });
  </code></pre>