void (ExtendableTextComponent.Extension ext) { ArrayList<ExtendableTextComponent.Extension> extensions = new ArrayList<>(myTextField.getExtensions()); extensions.add(0, ext); myTextField.setExtensions(extensions); }