Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1021047 // selectFromList2 - allows non-strings

JavaX fragment (include)

static <A> void selectFromList2(S title, final Collection<A> items, final VF1<A> r) {
  final JList list = jlist(allToString(items));
  onDoubleClickOrEnter(list, r {
    A a = collectionEntryAtIndex(items, selectedIndex(list));
    if (a != null) {
      disposePIFrame(list);
      callF(r, a);
    }
  });
  showCenterFrame(title, 300, 600, list);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021047
Snippet name: selectFromList2 - allows non-strings
Eternal ID of this version: #1021047/8
Text MD5: 952b5a1777bfa020ff1299d58e3a6408
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-19 18:01:29
Source code size: 362 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 289 / 337
Version history: 7 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)