1

I would like to know if there is a free Java library or a piece of software written in java that can highlight (or change the font format of) a specific text in a document using Java?

I have found something called Aspose, but it hard to me to find some libraries in it, also it is not free.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Daisy
  • 847
  • 3
  • 13
  • 34
  • 1
    Do you mean in a running Java GUI, or you need the 'highlight' to be included in the document when opened with other software? What document types are of interest? – Andrew Thompson Aug 21 '11 at 11:11
  • I need the highlight to be included in the document when opened. if i have a Microsoft word documents, i need to highlight a specific string (if found) in this document. – Daisy Aug 21 '11 at 11:35
  • OK.. so that is 'word docs' is one format. What *others?* (And no - I don't want to play '20 questions' here - try and improve the quality of information your replies). – Andrew Thompson Aug 21 '11 at 11:44
  • i think this link is good for you: [JTextPane][1] [1]: http://stackoverflow.com/questions/5674128/jtextpane-highlight-text – NrNazifi Dec 08 '11 at 15:14

1 Answers1

0

A simple solution is to use HTML in your string. Make the highlight bold or give it a color. More information see link below.

http://download.oracle.com/javase/tutorial/uiswing/components/html.html

Stijn Leenknegt
  • 1,317
  • 4
  • 12
  • 22