Libraryless. Click here for Pure Java version (14721L/102K).
1 | !7 |
2 | |
3 | module FontPlus > DynSingleFunctionWithPrintLog { |
4 | transient volatile bool active; |
5 | double scale = 1.25; |
6 | |
7 | start { |
8 | ownResource(vmBus_onMessage('mouseDown, voidfunc(int x, int y, int button) { |
9 | if (!active) ret; |
10 | active = false; |
11 | final JComponent c = optCast(JComponent, componentAtScreenLocation(x, y)); |
12 | print("Have component: " + c); |
13 | if (c == null) ret; |
14 | swing { |
15 | Font font = scaleFont(c.getFont(), scale); |
16 | c.setFont(font); |
17 | print("Enlarged font to " + formatDouble(font.getSize2D(), 1)); |
18 | } |
19 | })); |
20 | } |
21 | |
22 | void doIt { |
23 | print("Please click on a component to enlarge its font"); |
24 | set active; |
25 | } |
26 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1019642 |
Snippet name: | Font Plus |
Eternal ID of this version: | #1019642/6 |
Text MD5: | 7fc3dfd11b49a00e2035cc887f3677cf |
Transpilation MD5: | 3575b27e63a6bfb29a3bb8af37fbf317 |
Author: | stefan |
Category: | javax / stefan's os |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-11-15 16:40:37 |
Source code size: | 703 bytes / 26 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 336 / 2008 |
Version history: | 5 change(s) |
Referenced in: | [show references] |