JTextArea can display multiple lines of editable text. Although a text area can display text in any font, all of the text is in the same font. Use a text area to allow the user to enter unformatted text of any length or to display unformatted help information.
To achieve your goal, you may need to look into using another text component such as a JEditorPane or JTextPane. I recommend that you have a look at the tutorial linked above.