static void clearTextFieldSelectionAsync(final JTextComponent textField) {
    SwingUtilities.invokeLater(() -> {
      textField.select(0, 0);
      final int length = textField.getDocument().getLength();
      try {
        textField.setCaretPosition(length);
      } catch (Exception ignore) {
        System.err.println("Can't set caret position to length: " + length);
      }
    });
  }
Add popup with suggestion to text component
@param textComponent  text component
@param suggestionSource source of suggestions
@param suggestionRenderer renderer for suggestions
@param selectionListener suggestion listener to be executed after suggestion is selected
@param clearFocusAfterSelection true if text selection should be removed and caret set to end of text after selecting suggestion
@param <T> Suggestion type
olv-gui/src/main/java/pl/otros/swing/suggest/SuggestDecorator.java