// action can be Runnable or a function name static JButton newButton(fS text, final O action) { ret swing(func -> JButton { JButton btn = new JButton(text); if (action != null) btn.addActionListener(actionListener(action)); ret btn; }); }