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

17
LINES

< > BotCompany Repo | #1031250 // JLineHeightTextArea

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

Libraryless. Click here for Pure Java version (3142L/18K).

1  
sclass JLineHeightTextArea > JTextArea {
2  
  double lineHeightFactor = 1.0;
3  
  
4  
  *() {}
5  
  *(double *lineHeightFactor) {}
6  
  
7  
  @Override
8  
  public FontMetrics getFontMetrics(Font font) {
9  
      return new FontMetricsWrapper(super.getFontMetrics(font)) {
10  
          @Override
11  
          public int getHeight() {
12  
            return iround(super.getHeight()*lineHeightFactor);
13  
          }
14  
      };
15  
  }
16  
17  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031250
Snippet name: JLineHeightTextArea
Eternal ID of this version: #1031250/2
Text MD5: 3fcbeb0e6f9d87e887fb4280bd3d92f0
Transpilation MD5: 6946629b930780ca524eb9f84098394e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-25 19:10:23
Source code size: 410 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 205 / 379
Version history: 1 change(s)
Referenced in: [show references]