Setting fonts in a JTextArea
I've got a JTextArea which has the following text "Text1 Text2 Text3". Is there a way I can make all of them different fonts? E.g. "Text1" is bold, "Text2" is italic and "Text3" is normal?
I know I can create a Font object, however I can only apply it the JText开发者_StackOverflowArea object.
Thanks.
This is not possible in JTextArea. But you can use JTextPane or JEditorPane.
精彩评论