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

13
LINES

< > BotCompany Repo | #1015873 // selectFromList

JavaX fragment (include)

1  
static void selectFromList(S title, L<S> items, final VF1<S> onSelect) {
2  
  final JList list = jlist(items);
3  
  JButton btnOK = listDependentButton(list, "OK", r {
4  
    fS item = getSelectedItem(list);
5  
    if (item == null) ret;
6  
    disableButtonWhileCalcing2(func -> bool {
7  
      callF_returnTrueIfNoException(onSelect, item)
8  
    });
9  
  });
10  
  onDoubleClickOrEnter(list, rClickButton(btnOK));
11  
  showFrame(title, centerAndSouthWithMargins(list,
12  
    jcenteredline(btnOK, jCancelButton())));
13  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1015873
Snippet name: selectFromList
Eternal ID of this version: #1015873/5
Text MD5: 472129ed684ec37de9b5404c5d9665ff
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-29 14:14:48
Source code size: 489 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 456 / 411
Version history: 4 change(s)
Referenced in: [show references]