Java tutorial
//package com.java2s; import javax.swing.*; import java.awt.*; import java.awt.event.MouseEvent; public class Main { public static void showPopMenu(JPopupMenu popupMenu, MouseEvent e, Component source, Component destination) { final MouseEvent event = SwingUtilities.convertMouseEvent(source, e, destination); popupMenu.show(destination, event.getX(), event.getY()); } }