JBList<T> (@NotNull ListModel<T> model, ListCellRenderer<T> renderer) { JBList<T> list = new JBList<>(model); MouseAdapter mouseListener = new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (myApplyAction != null && e.getClickCount() > 1) myApplyAction.consume(e); } }; list.addMouseListener(mouseListener); list.setCellRenderer(renderer); list.setFocusable(false); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); list.putClientProperty(RenderingUtil.ALWAYS_PAINT_SELECTION_AS_FOCUSED, true); return list; }