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

15
LINES

< > BotCompany Repo | #1004938 // jlist - make JList from strings

JavaX fragment (include)

1  
static JList jlist(final L<S> l) {
2  
  ret (JList) swing(func {
3  
    new JList list;
4  
    final WeakReference<JList> ref = weakRef(list);
5  
    listPopupMenuItem(list, "Copy text to clipboard", r {
6  
      copyTextToClipboardIfNotNull(selectedItem(ref!))
7  
    });
8  
    fillListWithStrings(list, l);
9  
    ret list;
10  
  });
11  
}
12  
13  
static JList jlist(S... l) {
14  
  ret jlist(asList(l));
15  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004938
Snippet name: jlist - make JList from strings
Eternal ID of this version: #1004938/10
Text MD5: 6a9a2ef80b91d7de53f9d8da21881050
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-23 14:17:21
Source code size: 380 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 655 / 645
Version history: 9 change(s)
Referenced in: [show references]