please include function newButton. static JButtonWithInset jButtonWithInset(fS text, fO action) { ret swing(func -> JButtonWithInset { S text2 = dropPrefix("[disabled] ", text); final JButtonWithInset btn = new(text2); if (l(text2) < l(text)) btn.setEnabled(false); if (newButton_autoToolTip) { btn.setToolTipText(btn.getText()); //onChangeAndNow(btn, r { btn.setToolTipText(btn.getText()) }); } // submitButtonOnEnter(btn); // test this first if (action != null) btn.addActionListener(actionListener(action, btn)); ret btn; }); } static JButton jButtonWithInset(S text) { ret jButtonWithInset(text, null); } static JButton jButtonWithInset(Action action) { ret swingNu(JButtonWithInset, action); }