// 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); // submitButtonOnEnter(btn); // test this first if (action != null) btn.addActionListener(actionListener(action)); ret btn; }); }