views:

42

answers:

1

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 JTextArea object.

Thanks.

+2  A: 

This is not possible in JTextArea. But you can use JTextPane or JEditorPane.

Roman
Thank you, I'll try using a JTextPane.
vuj