Uses 3874K of libraries. Click here for Pure Java version (9471L/66K/223K).
1 | !7 |
2 | |
3 | concept UserScreenshot { |
4 | new Ref<PNGFile> pngFile; |
5 | } |
6 | |
7 | concept UserLine { |
8 | S text; |
9 | } |
10 | |
11 | static JTextField tfBla; |
12 | |
13 | p-substance-thread { |
14 | concepts(); |
15 | awt { |
16 | tfBla = jCenteredTextField(); |
17 | JFrame frame = showPackedFrame("Eye", centerAndSouth( |
18 | jimageButton(#1006830, "snap"), // Blue Eye |
19 | tfBla)); |
20 | tfBla.requestFocus(); |
21 | onEnter(tfBla, r { |
22 | tfBla.selectAll(); |
23 | S text = getText(tfBla); |
24 | cnew(UserLine, +text); |
25 | print("User says: " + text); |
26 | }); |
27 | moveToTopRightCorner(frame); |
28 | setAlwaysOnTop(frame); |
29 | hideConsole(); |
30 | } |
31 | } |
32 | |
33 | svoid snap { |
34 | tfBla.requestFocus(); |
35 | BufferedImage img = shootScreen2(); |
36 | infoBox("Screenshot made: " + img.getWidth() + "*" + img.getHeight() + " #" + cnew(UserScreenshot, pngFile := new PNGFile(img)).id); |
37 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1006832 |
Snippet name: | Eye Button [takes screenshots and saves typed lines] |
Eternal ID of this version: | #1006832/22 |
Text MD5: | db40f641162f15947f7ffbc0844ba83b |
Transpilation MD5: | 8195652b1019b3b6e4871dca276767e3 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-09-06 01:08:09 |
Source code size: | 828 bytes / 37 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 603 / 786 |
Version history: | 21 change(s) |
Referenced in: | [show references] |