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

31
LINES

< > BotCompany Repo | #1006114 // What is it? [collect comments on images, WORKS]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (8998L/61K/204K).

!759

concept UserComment {
  BWImage image;
  S imageMD5;
  S comment;
}

static L<GrabbedImage> images;

p {
  conceptsAndBot();
  
  images = getGrabbedImages();
  showTheForm();
}

// show random image and let user comment on it
svoid showTheForm {
  final GrabbedImage gi = random(images);
  if (gi == null) messageBox("No images grabbed! Run #1005951");
  
  UserComment uc = findConcept(UserComment, imageMD5 := gi.md5);
  final JTextField tf = jTextField(uc == null ? "" : uc.comment);
  showForm("Image", new ImageSurface(gi.image.getBufferedImage()),
    "What is it?", tf, r {
      cset(uniq(UserComment, imageMD5 := gi.md5),
        image := gi.image, comment := trim(tf.getText()));
      showTheForm();
    });
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

-
Snippet ID: #1006114
Snippet name: What is it? [collect comments on images, WORKS]
Eternal ID of this version: #1006114/1
Text MD5: b4c8e717b33651044afe98a8019f5ff8
Transpilation MD5: d33242e714a761796af9325053b30d56
Author: stefan
Category: javax / gui
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-19 23:39:51
Source code size: 757 bytes / 31 lines
Pitched / IR pitched: No / No
Views / Downloads: 469 / 584
Referenced in: