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

15
LINES

< > BotCompany Repo | #1022998 // Screen-Filling Text [OK, just a little slow]

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

Uses 911K of libraries. Click here for Pure Java version (4055L/20K).

!7

cmodule ScreenFillingText {
  S text = "TEST";
  float fontSize;
  
  transient JTextPane textPane;
  transient ReliableSingleThread rstAdjust = dm_rst(this, r {
    jTextPane_adjustTextSizeToFillParentHeight_wait(textPane);
    dm_setFieldUnlessNull(fontSize := fontSize(textPane));
  });
  
  visual onResize(rstAdjust, jscroll(textPane = fontSize(fontSize, dm_centeredTextPane('text))));
  start { dm_watchField('text, rstAdjust); }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022998
Snippet name: Screen-Filling Text [OK, just a little slow]
Eternal ID of this version: #1022998/23
Text MD5: 6fb9c7ac9bb166363088ca1347030854
Transpilation MD5: e3bfff77cd6406955c641fd5c2942cb6
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: 2019-04-20 01:37:57
Source code size: 455 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 269 / 843
Version history: 22 change(s)
Referenced in: [show references]