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

19
LINES

< > BotCompany Repo | #1030519 // jCenteredSection_fontSizePlus - jSection with centered title

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

Libraryless. Click here for Pure Java version (11812L/66K).

1  
import javax.swing.border.TitledBorder;
2  
3  
static JPanel jCenteredSection_fontSizePlus(int fontPlus, Component etc c) {
4  
  ret jCenteredSection_fontSizePlus(fontPlus, "", c);
5  
}
6  
7  
static JPanel jCenteredSection_fontSizePlus(int fontPlus, S title, Component etc c) {
8  
  ret swing(() -> {
9  
    JPanel p = jCenteredSection(title, c);
10  
    TitledBorder border = cast p.getBorder();
11  
    Font font = border.getTitleFont();
12  
    border.setTitleFont(font.deriveFont(font.getSize2D()+fontPlus));
13  
    ret p;
14  
  });
15  
}
16  
17  
static JPanel jCenteredSection_fontSizePlus(int fontPlus, S title) {
18  
  ret jCenteredSection_fontSizePlus(fontPlus, title, jpanel());
19  
}

Author comment

Began life as a copy of #1020286

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1030519
Snippet name: jCenteredSection_fontSizePlus - jSection with centered title
Eternal ID of this version: #1030519/6
Text MD5: 63d60e170bdf5bb6c24dd46a9ef49c86
Transpilation MD5: 7954d04b2c107b190165f39a1e4a1a5a
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-11-13 17:02:18
Source code size: 652 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 254 / 368
Version history: 5 change(s)
Referenced in: [show references]