wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "HTML in JTextPane/Editor" Watch "HTML in JTextPane/Editor" New topic

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
vicky bawge
Ranch Hand

Joined: Sep 04, 2001
Posts: 34
Have you thought of using JEditorPane.
Have you tried to invoke setContentType("text/html")
I agree. Here's the link: http://aspose.com/file-tools
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