sbool setText_opt = true; // optimize by calling getText first static A setText(A c, O text) { setText((O) c, text); ret c; } static A setText(final A c, O text) { // only for editable combo boxes at this point fS s = strUnnull(text); swing { c.getEditor().setItem(s); } ret c; } svoid setText(JLabel c, O text) { setText((O) c, text); } static JButton setText(JButton c, O text) { setText((O) c, jlabel_textAsHTML_center_ifNeeded(strUnnull(text))); ret c; } static A setText(final A c, O text) { if (c == null) null; final S s = strUnnull(text); swingAndWait(r { if (!setText_opt || neq(callOpt(c, "getText"), s)) call(c, "setText", s); }); ret c; }