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

28
LINES

< > BotCompany Repo | #1034502 // JG22Label - visualize an image recognition label

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (22389L/137K).

sclass JG22Label > SingleComponentPanel {
  G22Label label;
  
  JLabel jLabel;
  JTextField tf;
  
  event doneEditing(S text);
  
  *() { init(); }
  *(G22Label *label) { init(); }
  
  <A> A print(A a) { ret main print(a); }
  
  void init {
    onDoneEditing(text -> print("Done editing label"));
    
    if (label == null) {
      tf = jTextField();
      onEnter(tf, rThread { doneEditing(getTextTrim(tf)) });
      setComponent(tf);
    } else {
      jLabel = jLabel(label.name);
      setComponent(jLabel);
    }
  }
  
  JComponent focusablePart() { ret tf; }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034502
Snippet name: JG22Label - visualize an image recognition label
Eternal ID of this version: #1034502/10
Text MD5: ef9b3f6c0d45c52ee66782851328206a
Transpilation MD5: 377a5c2343742fbe6fea6f7a8fe266ed
Author: stefan
Category: javax / gazelle v / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-10 03:45:53
Source code size: 599 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 155 / 278
Version history: 9 change(s)
Referenced in: [show references]