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

12
LINES

< > BotCompany Repo | #1026596 // JAutoWidthHTMLLabel

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2717L/17K).

sclass JAutoWidthHTMLLabel extends JLabel {
  IF0<S> makeContents;
  
  *(IF0<S> *makeContents) {
    topAlignLabel(this);
    onResize(this, r update);
  }
  
  void update swing {
    setText(hhtml(hdiv(unnull(makeContents!), width := getWidth())));
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1026596
Snippet name: JAutoWidthHTMLLabel
Eternal ID of this version: #1026596/2
Text MD5: ef6e40d4fee05219ea815b0873938157
Transpilation MD5: 8aadb2a5136f03d6a7e342148178c509
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-15 14:20:37
Source code size: 268 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 159 / 484
Version history: 1 change(s)
Referenced in: #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)