changing the font in a JTextArea for different lines

后端 未结 1 1322
别那么骄傲
别那么骄傲 2021-01-18 03:33

I would like to append differnt lines of font to the JTextArea, however the last font seems to override the other.

Please help...

import java.awt.*         


        
相关标签:
1条回答
  • 2021-01-18 03:53

    Try using JEditorPane / JTextPane

    http://download.oracle.com/javase/tutorial/uiswing/components/editorpane.html

    These support HTML formatting. A normal JTextArea's setFont method will just set the font for the entire textarea.

    0 讨论(0)
提交回复
热议问题