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

19
LINES

< > BotCompany Repo | #1013488 // selectWebCam

JavaX fragment (include)

1  
!include once #1013490 // sarxos webcam
2  
3  
static void selectWebCam(final VF1<Webcam> onSelect) {
4  
  selectWebCam(new L(Webcam.getWebcams()), onSelect);
5  
}
6  
  
7  
static void selectWebCam(fL<Webcam> webcams, final VF1<Webcam> onSelect) {
8  
  LS camNames = mapMethod getName(webcams);
9  
  addToLocalMechList_uniq("All Web Cam Names", camNames);
10  
  if (l(webcams) == 1) { awt { callF(onSelect, first(webcams); } ret; }
11  
  final JComboBox cbCams = jcombobox(camNames);
12  
  selectItem(cbCams, preferredWebCamName());
13  
  Runnable go = r-awt {
14  
    callF(onSelect, webcams.get(getSelectedIndex(cbCams)))
15  
  };
16  
  onEnter(cbCams, go);
17  
  renameSubmitButton(showTitledForm("Select WebCam",
18  
    "Camera:", cbCams, go), "Select camera");
19  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1013488
Snippet name: selectWebCam
Eternal ID of this version: #1013488/17
Text MD5: 61c0160c58b003bdc1480a9ed3d06baf
Author: stefan
Category: javax / chat
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-23 21:40:42
Source code size: 730 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 555 / 600
Version history: 16 change(s)
Referenced in: [show references]