sbool newButton_autoToolTip = true;

sbool newButton_autoToolTip() { ret newButton_autoToolTip; }

// action can be Runnable or a function name
static JButton newButton(fS text, final O action) {
  ret swing(func -> JButton {
    S text2 = dropPrefix("[disabled] ", text);
    JButton btn = basicJButton(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;
  });
}