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

14
LINES

< > BotCompany Repo | #1007247 // withLeftMargin

JavaX fragment (include)

static int withLeftMargin_defaultWidth = 6;

static JPanel withLeftMargin(Component c) {
  ret withLeftMargin(withLeftMargin_defaultWidth, c);
}

static JPanel withLeftMargin(final int margin, final Component c) {
  ret swing(func -> JPanel {
    JPanel p = new JPanel(new BorderLayout);
    p.setBorder(BorderFactory.createEmptyBorder(0, margin, 0, 0));
    p.add(c);
    ret p;
  });
}

Author comment

Began life as a copy of #1006306

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: #1007247
Snippet name: withLeftMargin
Eternal ID of this version: #1007247/5
Text MD5: c321b1cd159788838aa5c7c790ab0eed
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-17 20:58:43
Source code size: 400 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 467 / 477
Version history: 4 change(s)
Referenced in: [show references]