static JComponent withTitle(String title, Component etc c) { ret withTitle(withTitle_titlePanel(title), c); } static JComponent withTitle_titlePanel(String title) { ret jlabel(title); } static JPanel withTitle(final JComponent titleComponent, final Component c) { ret swing(func -> JPanel { titleComponent.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("Button.borderColor"))); JPanel panel = new JPanel(new BorderLayout()); panel.setBackground(Color.WHITE); panel.add(BorderLayout.NORTH, titleComponent); panel.add(BorderLayout.CENTER, wrap(c)); return panel; }); }