不,您要找的是JEditorPane
它支持HTML(3.2?),可让您使用
<font>(和其他较早的标记)提供富文本格式。
JEditorPane textarea = new JEditorPane("text/html", "");textarea.setText("Here is some <b>bold text</b>");编辑 :根据我上面引用的javadoc,JEditorPane还支持有限的RTF。不要忘记将MIME更改为
text/rtf

不,您要找的是JEditorPane
它支持HTML(3.2?),可让您使用
<font>(和其他较早的标记)提供富文本格式。
JEditorPane textarea = new JEditorPane("text/html", "");textarea.setText("Here is some <b>bold text</b>");编辑 :根据我上面引用的javadoc,JEditorPane还支持有限的RTF。不要忘记将MIME更改为
text/rtf