void (JTextComponent component, boolean listener) { try { Highlighter highlighter = component.getHighlighter(); if (highlighter != null) highlighter.addHighlight(0, 0, this); } catch (BadLocationException ignored) { } if (listener) { component.addPropertyChangeListener(PROPERTY, this); } }