• Post Reply Bookmark Topic Watch Topic
  • New Topic

Highlight texts, what container should I pick

 
Ananth Chellathurai
Ranch Hand
Posts: 349
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
Here is my requirement, I parse a text file and currently displaying to a JTextArea.

But I got a new requirement to highlight few words from the text file while displaying to the user. What container I should use JEditorPane or JTextPane. Or is there a way to do it with Highlighter class in the JTextArea itself?

Any ideas would help me big time.

Regards
Ananth Chellathurai
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ananth Chellathurai:
What container I should use JEditorPane or JTextPane.


Any one will do depending on your requirement.
Both extend JTextComponent which has getHighlighter() which will be helpful to you.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!