void (@NotNull Component component, @NotNull @Nls String title, @NotNull ActionGroup group) { DefaultActionGroup actions = new GroupByActionGroup(); actions.addSeparator(" " + title); actions.addAll(group); DataContext context = DataManager.getInstance().getDataContext(component); JBPopup popup = new PopupFactoryImpl.ActionGroupPopup(null, actions, context, false, false, false, true, null, -1, null, null); popup.addListener(new JBPopupListener() { @Override public void beforeShown(@NotNull LightweightWindowEvent event) { Point location = component.getLocationOnScreen(); Dimension size = popup.getSize(); popup.setLocation(new Point(location.x + component.getWidth() - size.width, location.y + component.getHeight())); } }); popup.show(component); }