[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Adding / Removing Highlights in Swing

Posted on 2006-04-28
Medium Priority
Last Modified: 2006-11-18
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?

Question by:swp3h6
  • 2
LVL 86

Accepted Solution

CEHJ earned 252 total points
ID: 16563018
LVL 15

Assisted Solution

Javatm earned 248 total points
ID: 16563203
> 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() {
LVL 15

Expert Comment

ID: 16563207
> Simple of your using your using

Typo what I mean is if your using ;)

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month19 days, 19 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question