File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Using JTextPane for html Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Using JTextPane for html" Watch "Using JTextPane for html" New topic
Author

Using JTextPane for html

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
I am attempting to using a JTextPane to view html. I am getting the html from a string. Is this how you do it? The frame stuff is left out.

JTextPane textPane = new JTextPane();
textPane.setContentType("text/html");
textPane.setEditable(false);

textPane.setText( " some html string );

Thanks!
Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
Why not use JEditorPane? From Sun's tutorial:



Fun programming etcetera!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using JTextPane for html
 
Similar Threads
Displaying all of the text in a JTextPane How???
Accessing secure web pages with JTextPane
Unicode equivalent for <br>. Any idea?
how to print the contents of jtextpane.
My Program is not loading the image files in the jar.