static A bindTextComponentToIntLiveValue(final A tc, final SimpleLiveValue lv) { bindLiveValueListenerToComponent(tc, lv, // doing it in next AWT cycle to avoid "Attempt to mutate in notification" r-awt { setTextKeepCaret(tc, strOrNull(lv!)) }); onChange(tc, r { S s = gtt(tc); if (isInteger(s) || empty(s)) lv.set(parseIntOpt(s)); }); ret tc; }