How to get the component that invoked a JPopupMenu? Use the getInvoker() method. Component invoker = popupMenu.getInvoker();