Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


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
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: HTML in JTextPane/Editor
 
jQuery in Action, 3rd edition