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

19
LINES

< > BotCompany Repo | #1013488 // selectWebCam

JavaX fragment (include)

!include once #1013490 // sarxos webcam

static void selectWebCam(final VF1<Webcam> onSelect) {
  selectWebCam(new L(Webcam.getWebcams()), onSelect);
}
  
static void selectWebCam(fL<Webcam> webcams, final VF1<Webcam> onSelect) {
  LS camNames = mapMethod getName(webcams);
  addToLocalMechList_uniq("All Web Cam Names", camNames);
  if (l(webcams) == 1) { awt { callF(onSelect, first(webcams); } ret; }
  final JComboBox cbCams = jcombobox(camNames);
  selectItem(cbCams, preferredWebCamName());
  Runnable go = r-awt {
    callF(onSelect, webcams.get(getSelectedIndex(cbCams)))
  };
  onEnter(cbCams, go);
  renameSubmitButton(showTitledForm("Select WebCam",
    "Camera:", cbCams, go), "Select camera");
}

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: 554 / 598
Version history: 16 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1014779 - selectSnippetID
#1020888 - selectWebCam_withPreferred - saves preferred cam name & auto-selects it