JComponent () { myMouseMotionListener = new MyMouseMotionListener(); myMouseListener = new MyMouseListener(); ListPopupStep<Object> step = getListStep(); myListModel = new ListPopupModel(this, getSpeedSearch(), step); myList = new MyList(); myList.setVisibleRowCount(DEFAULT_MAX_ROW_COUNT); if (myStep.getTitle() != null) { myList.getAccessibleContext().setAccessibleName(myStep.getTitle()); } if (step instanceof ListPopupStepEx) { ((ListPopupStepEx<?>)step).setEmptyText(myList.getEmptyText()); } myList.setSelectionModel(new MyListSelectionModel()); selectFirstSelectableItem(); myList.setBorder(new EmptyBorder(getListInsets())); ScrollingUtil.installActions(myList); myList.setCellRenderer(getListElementRenderer()); registerAction("handleSelection1", KeyEvent.VK_ENTER, 0, new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { handleSelect(true, createKeyEvent(e, KeyEvent.VK_ENTER)); } }); myList.getActionMap().put(ListActions.Right.ID, new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { Object selected = myList.getSelectedValue(); if (selected != null && myPopupInlineActionsSupport.hasExtraButtons(selected)) { if (nextExtendedButton(selected)) return; } handleRightKeyPressed(createKeyEvent(e, KeyEvent.VK_RIGHT)); } }); myList.getActionMap().put(ListActions.Left.ID, new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { Object selected = myList.getSelectedValue(); if (selected != null && myPopupInlineActionsSupport.hasExtraButtons(selected)) { if (prevExtendedButton(selected)) return; } disposeAsyncPopupWaiter(); if (isClosableByLeftArrow()) { goBack(); } else { handleLeftKeyPressed(createKeyEvent(e, KeyEvent.VK_LEFT)); } } }); myList.addListSelectionListener(new ListSelectionListener() { private int prevItemIndex = -1; @Override public void valueChanged(ListSelectionEvent e) { if (prevItemIndex == myList.getSelectedIndex()) return; prevItemIndex = myList.getSelectedIndex(); myList.setSelectedButtonIndex(null); disposeAsyncPopupWaiter(); } }); PopupUtil.applyNewUIBackground(myList); myList.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); return myList; }