您只能整体更改JTextPane的字体,而不能更改RTF文本。
有一个
document下面的JEditorPane(显然的JTextPane太),你得到的与保持
getdocument()。您希望将其转换为a
Styleddocument,然后可以
setCharacterAttributes对给定的字符序列进行操作。
Java教程http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html上有一些(希望)有用的示例。



