Libraryless. Click here for Pure Java version (22389L/137K).
1 | sclass JG22Label > SingleComponentPanel { |
2 | G22Label label; |
3 | |
4 | JLabel jLabel; |
5 | JTextField tf; |
6 | |
7 | event doneEditing(S text); |
8 | |
9 | *() { init(); } |
10 | *(G22Label *label) { init(); } |
11 | |
12 | <A> A print(A a) { ret main print(a); } |
13 | |
14 | void init { |
15 | onDoneEditing(text -> print("Done editing label")); |
16 | |
17 | if (label == null) { |
18 | tf = jTextField(); |
19 | onEnter(tf, rThread { doneEditing(getTextTrim(tf)) }); |
20 | setComponent(tf); |
21 | } else { |
22 | jLabel = jLabel(label.name); |
23 | setComponent(jLabel); |
24 | } |
25 | } |
26 | |
27 | JComponent focusablePart() { ret tf; } |
28 | } |
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: | 157 / 281 |
Version history: | 9 change(s) |
Referenced in: | [show references] |