JBPopup (@NotNull @NlsContexts.PopupTitle String title, @NotNull List<String> options, @NotNull Consumer<? super String> onChosen) { return JBPopupFactory.getInstance() .createPopupChooserBuilder(options) .setTitle(title) .setMovable(true) .setItemChosenCallback(onChosen::accept) .setAutoselectOnMouseMove(true) .setNamerForFiltering(o -> o) .setRenderer(BuilderKt.textListCellRenderer((@NlsSafe var name) -> name)) .withFixedRendererSize(new Dimension(JBUI.scale(350), JBUI.CurrentTheme.List.rowHeight())) // do not freeze on huge lists .createPopup(); }