please include function componentPopupMenu. static JPopupMenu showInternalFramePopupMenu(final JInternalFrame f) { ret f == null ? null : swing(func -> JPopupMenu { componentPopupMenu_init(); L maker = cast _get(findComponentPopupMenuListener_gen(f), 'maker); if (empty(maker)) null; new JPopupMenu menu; int emptyCount = menu.getComponentCount(); componentPopupMenu_mouseEvent.set(new MouseEvent (f, MouseEvent.MOUSE_PRESSED, now(), 0, 30, 15, 1, true)); for (O menuMaker : maker) pcallF(menuMaker, menu); // show menu if any items in it if (menu.getComponentCount() == emptyCount) null; menu.show(f, 30, 15); // ? ret menu; }); }