How to use html tags in JTextArea

后端 未结 2 930
感情败类
感情败类 2021-02-14 07:50

When I try to change color of a JTextArea using

textArea.setText(\"  Hi \")
<
2条回答
  •  隐瞒了意图╮
    2021-02-14 07:52

    • don't to use JTextArea for Html formatted Object (even is possible, but why bothering)

    • use JTextPane / JEditorPane instead (setContentType("text/html"))

    • notice, todays Java and methods implemented in Official API by Oracle supporting only reduced Html syntax with css <= Html 3.2

    • use JavaFX in the case that you want/need to use todays Html5,

提交回复
热议问题