import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;

class MouseDragPopup {
    public static void main(String[] args) {
        final JFrame frame = new JFrame("Mouse Drag Popup");
        final JPanel panel = new JPanel();
        final JPanel innerPanel = new JPanel();
        final JPopupMenu menu = new JPopupMenu();
        menu.add("This should not appear (and does not under Linux/Windows)");
        innerPanel.setComponentPopupMenu(menu);
        panel.add(new JLabel("Right click and drag from here"));
        panel.add(innerPanel);
        panel.add(new JLabel("to here"));
        frame.add(panel);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    }
}