This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Using JTextPane for html" Watch "Using JTextPane for html" New topic

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.setText( " some html string );

Dave Wingate
Ranch Hand

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

Fun programming etcetera!
It is sorta covered in the JavaRanch Style Guide.
subject: Using JTextPane for html
It's not a secret anymore!