public void actionPerformed(final AnActionEvent e) { @NonNls final String delim = " -> "; final StringBuffer buf = new StringBuffer(); processDependencies( getSelectedScope(myLeftTree), getSelectedScope(myRightTree), new Processor<List<PsiFile>>() { public boolean process(final List<PsiFile> path) { if (buf.length() > 0) buf.append("<br>"); buf.append( StringUtil.join( path, new Function<PsiFile, String>() { public String fun(final PsiFile psiFile) { return psiFile.getName(); } }, delim)); return true; } }); final JEditorPane pane = new JEditorPane(UIUtil.HTML_MIME, "<html>" + buf.toString() + "</html>"); pane.setForeground(Color.black); pane.setBackground(HintUtil.INFORMATION_COLOR); pane.setOpaque(true); final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(pane); final Dimension dimension = pane.getPreferredSize(); scrollPane.setMinimumSize(new Dimension(dimension.width, dimension.height + 20)); scrollPane.setPreferredSize(new Dimension(dimension.width, dimension.height + 20)); JBPopupFactory.getInstance() .createComponentPopupBuilder(scrollPane, pane) .setTitle("Dependencies") .setMovable(true) .createPopup() .showInBestPositionFor(e.getDataContext()); }