question: private void showContextMenu ( final PInputEvent event ) { event . setHandled ( true ) ; JPopupMenu contextMenu = getContextMenu ( ) ; Point2D canvasPosition = event . getCanvasPosition ( ) ; networkPanel . setLastClickedPosition ( canvasPosition ) ; contextMenu . show ( networkPanel . getCanvas ( ) , ( int ) canvasPosition . getX ( ) , ( int ) canvasPosition . getY ( ) ) ; }
target:  Show the context menu.