private boolean isCurrentLineHighlighted( int offset ) {
		try {
			return getHighlightCurrentLine() &&
				getSelectionStart() == getSelectionEnd() &&
				getLineOfOffset( offset ) == getLineOfOffset( getSelectionStart() );
		} catch( BadLocationException ex ) {
			return false;
		}
	}
A text area that supports editing FlatLaf themes.

@author Karl Tauber
flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatSyntaxTextArea.java