Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Removing specific highlighted Area
Removing specific highlighted Area [message #1748851] Tue, 29 November 2016 10:50
Aziz Hohenheim is currently offline Aziz HohenheimFriend
Messages: 12
Registered: November 2016
Junior Member
Hello community,

I created a small UI application using Java SWT.
The UI contains a JTextArea where specific text parts should be highlighted. I was to able to implement this functionality, so there aren't any issues so far:

Highlighter highlighter = requestPositionTextArea.getHighlighter();
HighlightPainter painter =  new DefaultHighlighter.DefaultHighlightPainter(Color.cyan);

highlighter.addHighlight(startIndex, endIndex,painter);

As you can see I am using two Integer values startIndex and [endIndex
to highlight a specific part.

Can anyone tell me how I could delete exactly this part of the highlight again?
I saw other examples but they remove all highlights at once which I don't want to do.

Best regards,
Aziz Hohenheim
Previous Topic:Can't seem to find out how to write any code
Next Topic:Indigo (3.7) project will not run in Neon (4.6)
Goto Forum:

Current Time: Sat Oct 24 09:07:33 GMT 2020

Powered by FUDForum. Page generated in 0.02328 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top