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

14
LINES

< > BotCompany Repo | #1007247 // withLeftMargin

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

Libraryless. Click here for Pure Java version (9216L/51K).

static int withLeftMargin_defaultWidth = 6;

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

static JPanel withLeftMargin(int margin, Component etc 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/7
Text MD5: d92ef0847936a169e14be2086d7e6553
Transpilation MD5: d42e388d5d520417255aa39c5c5178c8
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-10-16 15:17:35
Source code size: 396 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 567 / 597
Version history: 6 change(s)
Referenced in: [show references]