简体   繁体   English

如何使用Java突出显示文档中的文本?

[英]How to highlight text in a document using Java?

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? 我想知道是否有免费的Java库或用Java编写的软件可以使用Java突出显示文档中特定文本(或更改其字体格式)?

I have found something called Aspose, but it hard to me to find some libraries in it, also it is not free. 我找到了一个叫做Aspose的东西,但是我很难在其中找到一些库,它也不是免费的。

A simple solution is to use HTML in your string. 一个简单的解决方案是在字符串中使用HTML。 Make the highlight bold or give it a color. 使高亮显示为粗体或为其赋予颜色。 More information see link below. 更多信息,请参见下面的链接。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM