Reputation: 913
I have a JEditorPane
where I'll copy some text from other application e.g. Adobe Pagemaker, Corel Draw etc. I want to keep my fonts unchanged. How can I do it ?
Upvotes: 0
Views: 170
Reputation: 205875
I want a
JEditorPane
with different font.
The examples in How to Use Editor Panes and Text Panes may guide you in this. In particular, TextComponentDemo
illustrates changing font characteristics both programmatically and interactively. See initDocument()
for details.
Upvotes: 2
Reputation: 25725
You have to set it in StyleContext
, a default font and then set the StyleContext
object for your JEditorPane
Read about StyleContext
Upvotes: 1