Libraryless. Click here for Pure Java version (3999L/24K).
1 | import javax.swing.border.TitledBorder; |
2 | |
3 | static JPanel jCenteredSection(Component c) { |
4 | ret jCenteredSection("", c); |
5 | } |
6 | |
7 | static JPanel jCenteredSection(S title, Swingable c) { |
8 | ret jCenteredSection(title, wrap(c)); |
9 | } |
10 | |
11 | static JPanel jCenteredSection(S title, Component c) { |
12 | ret swing(func -> JPanel { |
13 | JPanel p = jSection(title, c); |
14 | ((TitledBorder) p.getBorder()).setTitleJustification(TitledBorder.CENTER); |
15 | ret p; |
16 | }); |
17 | } |
18 | |
19 | static JPanel jCenteredSection(S title) { |
20 | ret jCenteredSection(title, jpanel()); |
21 | } |
Began life as a copy of #1006228
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1016951 |
Snippet name: | jCenteredSection - jSection with centered title |
Eternal ID of this version: | #1016951/4 |
Text MD5: | 48890f842bf8a4021d01be10bc821fa9 |
Transpilation MD5: | 2b0c6734ef7b1d448ed0d203976ae15a |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-03-19 16:37:18 |
Source code size: | 543 bytes / 21 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 555 / 672 |
Version history: | 3 change(s) |
Referenced in: | [show references] |