File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTML in JTextPane/Editor