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

26
LINES

< > BotCompany Repo | #1019642 // Font Plus

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (14721L/102K).

!7

module FontPlus > DynSingleFunctionWithPrintLog {
  transient volatile bool active;
  double scale = 1.25;
  
  start {
    ownResource(vmBus_onMessage('mouseDown, voidfunc(int x, int y, int button) {
      if (!active) ret;
      active = false;
      final JComponent c = optCast(JComponent, componentAtScreenLocation(x, y));
      print("Have component: " + c);
      if (c == null) ret;
      swing {
        Font font = scaleFont(c.getFont(), scale);
        c.setFont(font);
        print("Enlarged font to " + formatDouble(font.getSize2D(), 1));
      }
    }));
  }
  
  void doIt {
    print("Please click on a component to enlarge its font");
    set active;
  }
}

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: 334 / 2006
Version history: 5 change(s)
Referenced in: [show references]