void () { myList.removeAll(); myList.setModel(JBList.createDefaultListModel(myOptions)); if (myRenderer != null) { myList.setCellRenderer(myRenderer); } final Rectangle rect = myTable.getCellRect(myRow, myColumn, true); Point point = new Point(rect.x, rect.y); final boolean surrendersFocusOnKeystrokeOldValue = myTable instanceof JBTable ? ((JBTable)myTable).surrendersFocusOnKeyStroke() : myTable.getSurrendersFocusOnKeystroke(); final JBPopup popup = JBPopupFactory.getInstance() .createListPopupBuilder(myList) .setItemChosenCallback(() -> { myValue = myList.getSelectedValue(); final ActionEvent event = new ActionEvent(myList, ActionEvent.ACTION_PERFORMED, "elementChosen"); for (ActionListener listener : myListeners) { listener.actionPerformed(event); } TableUtil.stopEditing(myTable); myTable.setValueAt(myValue, myRow, myColumn); // on Mac getCellEditorValue() called before myValue is set. myTable.tableChanged(new TableModelEvent(myTable.getModel(), myRow)); // force repaint }) .setCancelCallback(() -> { TableUtil.stopEditing(myTable); return true; }) .addListener(new JBPopupListener() { @Override public void beforeShown(@NotNull LightweightWindowEvent event) { myTable.setSurrendersFocusOnKeystroke(false); } @Override public void onClosed(@NotNull LightweightWindowEvent event) { myTable.setSurrendersFocusOnKeystroke(surrendersFocusOnKeystrokeOldValue); } }) .setMinSize(myWide ? new Dimension(((int)rect.getSize().getWidth()), -1) : null) .createPopup(); popup.show(new RelativePoint(myTable, point)); }