Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

html inside JTextarea  RSS feed

 
Hamsagayathri Palanisamy
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can anyone please say me how to add html tags inside JTextarea?
Thanks in Advance.

-Thanks & Regards,
Hamsa
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use JEditorPane or JTextPane to display HTML. You might want to call setEditable(false) on the JEditorPane to make it look better, but users won't be able to edit it.

JTextArea is much less capable of using different styles.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!