void () { myListener.canSelectStateChanged(this, false); myResultList.setPaintBusy(true); // evaluate text value in the swing thread final String text = mySearchField.getText(); myAlarm.cancelAllRequests(); myAlarm.addRequest(() -> { try { doSearch(text); } catch (Throwable e) { MavenLog.LOG.warn(e); } }, 500); }