static int withMargin_defaultWidth = 6; static JPanel withMargin(Component c) { ret withMargin(withMargin_defaultWidth, c); } static JPanel withMargin(int w, Component c) { ret withMargin(w, w, c); } static JPanel withMargin(int w, int h, Component c) { ret withMargin(w, h, w, h, c); } static JPanel withMargin(final int top, final int left, final int bottom, final int right, final Component c) { ret swing(func -> JPanel { JPanel p = marginPanel(); p.setBorder(BorderFactory.createEmptyBorder(top, left, bottom, right)); p.add(c); ret p; }); }
download show line numbers debug dex old transpilations
Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, mqsvbyillbrs, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1004714 |
| Snippet name: | withMargin |
| Eternal ID of this version: | #1004714/7 |
| Text MD5: | 8ac52a56fb34640eb4e1ef2597e0eb04 |
| Author: | stefan |
| Category: | javax / gui |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-10-29 03:04:15 |
| Source code size: | 597 bytes / 22 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 1162 / 1206 |
| Version history: | 6 change(s) |
| Referenced in: | #1004959 - withBottomMargin #1005681 - withInset - synonym of withMargin #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1014641 - setMargin #1015739 - applyDefaultMargin |