This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes HTML in JTextPane/Editor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "HTML in JTextPane/Editor" Watch "HTML in JTextPane/Editor" New topic
Author

HTML in JTextPane/Editor

cardwell cupp
Ranch Hand

Joined: Aug 16, 2001
Posts: 66
Hey guys...I am working on a program that displays html in a JTextPane. When I load a file with setView(someFile), it works just fine, but if I just do setText(), I get the html as plain text. I don't want to have to write the html to a file just to make it work. Any suggestions/solutions?
Thanks All
Cardwell
vicky bawge
Ranch Hand

Joined: Sep 04, 2001
Posts: 34
Have you thought of using JEditorPane.
Have you tried to invoke setContentType("text/html")
Vicky
 
 
subject: HTML in JTextPane/Editor
 
Similar Threads
Clearing JTextPane's Document!
PDF JEditorPane
How to put a hypertext in JEditorPane
Load a file from disk into JEditorPane or JTextPane etc
Page size when printing html from JTextPane