I am new to Swing development and I am creating a Java application where a user can load text documents and tag parts of text.
The tagged parts of text would then be highlighted and the user can click on the tagged text to edit/remove the tag. Is there any library/class that I can use to achieve this.
I have already looked at JTextArea
. But to best of my knowledge it can only display plain text (correct me if I am wrong)
To be more clear of what I am looking for:
When you tag a question on Stack Overflow (SO), the tags are highlighted with a little box and highlighting around the tag. I am looking something similar in Java.
So, if the component that I add is say X, then X should be able to hold plain text as well as tagged text. The tagged text should look like the SO tags.
Edit
An example for clarification.
Original Text:
This is some sample text.
After tagging, say sample, this is what it should look like:
With Tagged Text
That x is basically a button to remove all tags associated with sample.