Im using the DefaultHightlighter.DefaultHightlighterPainter to highlight text within a java text pane. I want to remove all highlights (there could be more than one
DefaultHightlighter.DefaultHightlighterPainter
If you remove all highlights (I suppose with removeAllHighlights) you can getHighlights before that and use the information you receive there.
removeAllHighlights
getHighlights