Libraryless. Click here for Pure Java version (7033L/39K).
1 | static int vstackWithSpacing_fixed_default = 10; |
2 | |
3 | static JPanel vstackWithSpacing_fixed(L parts, int spacing default vstackWithSpacing_fixed_default) { |
4 | ret swing(-> { |
5 | JPanel panel = new JPanel(new GridBagLayout); |
6 | new GridBagConstraints gbc; |
7 | gbc.weightx = 1; |
8 | gbc.fill = GridBagConstraints.HORIZONTAL; |
9 | gbc.gridwidth = GridBagConstraints.REMAINDER; |
10 | gbc.insets = new Insets(0, 0, spacing, 0); |
11 | smartAddWithLayout(panel, gbc, flattenToArray(parts)); |
12 | gbc.weighty = 1; |
13 | gbc.insets = new Insets(0, 0, 0, 0); |
14 | panel.add(jrigid(), gbc); |
15 | ret panel; |
16 | }); |
17 | } |
18 | |
19 | static JPanel vstackWithSpacing_fixed(int spacing default vstackWithSpacing_fixed_default, Component... parts) { |
20 | ret vstackWithSpacing_fixed(asList(parts), spacing); |
21 | } |
Began life as a copy of #1006626
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034304 |
Snippet name: | vstackWithSpacing_fixed - stack components vertically. fixed top margin |
Eternal ID of this version: | #1034304/3 |
Text MD5: | 67b64bfe8fd2f6245b94590a3c3cd7b8 |
Transpilation MD5: | e2625ea6c0872807e3eec55bbde691b2 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-02-01 17:50:58 |
Source code size: | 779 bytes / 21 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 134 / 196 |
Version history: | 2 change(s) |
Referenced in: | [show references] |