• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JTextPane for html

 
Barry Brashear
Ranch Hand
Posts: 303
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 262
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not use JEditorPane? From Sun's tutorial:

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic