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

14
LINES

< > BotCompany Repo | #1006529 // withTopMargin

JavaX fragment (include)

1  
static int withTopMargin_defaultWidth = 6;
2  
3  
static JPanel withTopMargin(Component c) {
4  
  ret withTopMargin(withTopMargin_defaultWidth, c);
5  
}
6  
7  
static JPanel withTopMargin(final int w, final Component c) {
8  
  ret swing(func -> JPanel {
9  
    JPanel p = new JPanel(new BorderLayout);
10  
    p.setBorder(BorderFactory.createEmptyBorder(w, 0, 0, 0));
11  
    p.add(c);
12  
    ret p;
13  
  });
14  
}

Author comment

Began life as a copy of #1004959

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006529
Snippet name: withTopMargin
Eternal ID of this version: #1006529/5
Text MD5: e1e88141b3dd50efdfe50795c2846540
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-04 18:58:25
Source code size: 385 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 528 / 574
Version history: 4 change(s)
Referenced in: [show references]