static void selectFromList(S title, L items, VF1 onSelect) { final JList list = jlist(items); showFrame(title, centerAndSouthWithMargins(list, jcenteredline(listDependentButton("OK", r { fS item = getSelectedItem(list); if (item == null) ret; disableButtonWhileCalcing2(func -> bool { callF_returnTrueIfNoException(onSelect, item) }); }, jbutton("Cancel", r { disposeWindow(heldInstance(JButton)) })))); }