static JList jlist(final L l) { ret (JList) swing(func { new JList list; final WeakReference ref = weakRef(list); listPopupMenuItem(list, "Copy text to clipboard", r { copyTextToClipboardIfNotNull(selectedItem(ref!)) }); fillListWithStrings(list, l); ret list; }); } static JList jlist(S... l) { ret jlist(asList(l)); }