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

HTML in JTextArea  RSS feed

 
jack nick
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I need to have an html embedded in a JTextArea. Could anybody direct me if this is achievable. I thought it was as simple as setting the JTextArea with an html string. Alas that does not work.
Thnks
Jack
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No... JTextArea is for plain text display only... for HTML, you must use JEditorPane or one of its subclasses.
 
Jaunty John
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jack,
I know this is going to be a stupid question, but when you say, "embedded in a JTextArea", do you mean rendered, like a page in a browser application, or rendered, like in a WYSIWYG HTML composer, or, are you simply talking about the code for an HTML page?
Thanks
JB
 
Eli Daum
Greenhorn
Posts: 12
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!