Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using JTextPane for html  RSS feed

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

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!