Adding / Removing Highlights in Swing

I'm working with an application that can highlight certain entries in a document.  It uses a .properties file to hold all the highlights, and currently, removing a highlight involves modifying the .properties file, and refreshing the entire application.  This takes too long.  Is there a way to add/remove highlights without saving changes to a .properties file and / or refreshing?

thanks.
swp3h6Asked:
Who is Participating?
 
JavatmConnect With a Mentor Commented:
> This takes too long.  Is there a way to add/remove highlights without saving changes to a .properties file and / or refreshing?

Simple of your using your using or extending DefaultHighlighter there is a method called removeHighlight and this is how I use it:

    public void removeHighlight() {
          highlighter.removeHighlight(lastHighlight);
    }
0
 
JavatmCommented:
> Simple of your using your using

Typo what I mean is if your using ;)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.