Consumer<MouseEvent> () { return event -> { resetActionIcon(); myStatusBar.updateWidget(WIDGET_ID); Component component = event.getComponent(); ListPopup popup = createMainPopup(DataManager.getInstance().getDataContext(component)); 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 - size.height)); } }); popup.show(component); }; }