title: How to get current Position on screen for current selected Cell?
body: <p>I´d like to open a context-menu, when the user hits a specific key. So I registered a Key EventHandler, and succeded to open a contextmenu, but unfortunatly I am not able to determine the correct position for the contextmenu.</p>
  
  <p>I´d like to open it just below the currently selected cell:</p>
  
  <p><img src="https://i.stack.imgur.com/psaF4.png" alt="enter image description here"></p>
  
  <p>I am lost determining the correct position for the contextmenu to show up:</p>
  
  <pre><code>//Showcase Code:
  treeTableView.setOnKeyPressed( new EventHandler&lt;KeyEvent&gt;()
  {
     @Override
     public void handle( final KeyEvent keyEvent )
     {
      final TreeItem&lt;Item&gt; selectedItem = treeTableView.getSelectionModel().getSelectedItem();
  
      if ( selectedItem != null )
      {
        if ( keyEvent.getCode().equals( KeyCode.INSERT ) )
        {
          final ContextMenu rowMenu = new ContextMenu();
  
          Menu deleteMenu = new Menu( "Delete" );
          final MenuItem deleteItem = new MenuItem( selectedItem.getValue().getName() );
          deleteMenu.getItems().add( deleteItem );
          rowMenu.getItems().add( deleteMenu );
          rowMenu.show( treeTableView.getScene().getWindow() );//How to get X and Y of current selected cell/row?
        }
      }
     }
   }
  </code></pre>
  
  <p>Can anyone help me to determine the correct X and Y position from treeTableViews bottom left corner of the currently selected row/cell?</p>
  
  <p>EDIT:</p>
  
  <p>Added Small Example:</p>
  
  <pre><code>public class TreeTableViewKeyListenerOnRow extends Application
  {
    @Override
    public void start( final Stage primaryStage )
    {
      TreeItem&lt;Item&gt; root = new TreeItem&lt;&gt;( new Item( "Root" ) );
  
      TreeItem&lt;Item&gt; item1 = new TreeItem&lt;&gt;( new Item( "Item1" ) );
      TreeItem&lt;Item&gt; item2 = new TreeItem&lt;&gt;( new Item( "Item2" ) );
      TreeItem&lt;Item&gt; item3 = new TreeItem&lt;&gt;( new Item( "Item3" ) );
  
      root.getChildren().add( item1 );
      item1.getChildren().add( item2 );
      root.getChildren().add( item3 );
  
      TreeTableColumn&lt;Item, String&gt; column = new TreeTableColumn&lt;&gt;( "Column" );
  
      column.setCellValueFactory( new TreeItemPropertyValueFactory&lt;Item, String&gt;( "name" ) );
  
      final TreeTableView&lt;Item&gt; treeTableView = new TreeTableView&lt;&gt;( root );
      treeTableView.getColumns().add( column );
      treeTableView.setShowRoot( false );
      treeTableView.setColumnResizePolicy( TreeTableView.CONSTRAINED_RESIZE_POLICY );
  
      treeTableView.setRowFactory( new Callback&lt;TreeTableView&lt;Item&gt;, TreeTableRow&lt;Item&gt;&gt;()
      {
        @Override
        public TreeTableRow&lt;Item&gt; call( final TreeTableView&lt;Item&gt; tableView )
        {
          final TreeTableRow&lt;Item&gt; row = new TreeTableRow&lt;&gt;();
          row.setFocusTraversable( true );
  
          row.setOnKeyPressed( new EventHandler&lt;KeyEvent&gt;()
          {
            @Override
            public void handle( final KeyEvent keyEvent )
            {
              System.out.println( "FIRE!" );//Not Fireing?
  
              final TreeItem&lt;Item&gt; selectedItem = row.getTreeItem();
  
              if ( selectedItem != null )
              {
                if ( keyEvent.getCode().equals( KeyCode.INSERT ) )
                {
                  final ContextMenu menu = new ContextMenu();
  
                  Menu deleteMenu = new Menu( "Delete" );
                  final MenuItem deleteItem = new MenuItem( selectedItem.getValue().getName() );
                  deleteMenu.getItems().add( deleteItem );
                  menu.getItems().add( deleteMenu );
  
                  // compute bounds of row in screen:
                  Bounds boundsInScreen = row.localToScreen( row.getBoundsInLocal() );
                  double x = boundsInScreen.getMinX();
                  double y = boundsInScreen.getMinY();
  
                  menu.show( treeTableView.getScene().getWindow(), x, y );
                }
              }
            }
          } );
  
          return row;
        }
      } );
  
      BorderPane layout = new BorderPane();
      layout.setCenter( treeTableView );
      Scene scene = new Scene( layout, 400, 400 );
      scene.getStylesheets().add( getClass().getResource( "application.css" ).toExternalForm() );
      scene.getStylesheets().add( getClass().getResource( "contextmenu.css" ).toExternalForm() );
      primaryStage.setScene( scene );
      primaryStage.show();
    }
  
    public static void main( final String[] args )
    {
      launch( args );
    }
  }
  </code></pre>