import javax.swing.border.TitledBorder; static JPanel jCenteredSection(Component c) { ret jCenteredSection("", c); } static JPanel jCenteredSection(S title, Swingable c) { ret jCenteredSection(title, wrap(c)); } static JPanel jCenteredSection(S title, Component c) { ret swing(func -> JPanel { JPanel p = jSection(title, c); ((TitledBorder) p.getBorder()).setTitleJustification(TitledBorder.CENTER); ret p; }); } static JPanel jCenteredSection(S title) { ret jCenteredSection(title, jpanel()); }