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

9
LINES

< > BotCompany Repo | #1021027 // fontSizeTimes - increase JComponent's font size with a factor

JavaX fragment (include)

1  
static <A extends JComponent> A fontSizeTimes(final double factor, final A c) {
2  
  if (c != null) swing {
3  
    Font font = c.getFont();
4  
    Font font2 = font.deriveFont((float) (font.getSize2D()*factor));
5  
    printVars(+font, +font2);
6  
    c.setFont(font2);
7  
  }
8  
  ret c;
9  
}

Author comment

Began life as a copy of #1020383

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1021027
Snippet name: fontSizeTimes - increase JComponent's font size with a factor
Eternal ID of this version: #1021027/4
Text MD5: 75d3c77b36e0e1a7a45951843c6b5001
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-12 09:52:30
Source code size: 277 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 259 / 299
Version history: 3 change(s)
Referenced in: [show references]