Changing the way JTextPane renders HTML

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Changing the way JTextPane renders HTML

Threaded View

  1. #1
    Join Date
    May 2005

    Exclamation Changing the way JTextPane renders HTML

    Hello, I am using Java's JTextPane to display an HTML (with possibly CSS/XML) page. What I want to do is alter the way it renders some tags (like <!-- comment tags -->, or Flash <object> tags) and add additional tags to its rendering capability, both by hardcoding, and possibly (though this is of secondary importance) dynamically, to accomodate XML.

    For example, JTextPane, by default, cannot render .swf flash files. It displays two red "??." I would like to be able to change that to a notice stating that JTextPane does not support flash objects.

    For another example, It seems to be excluding the end ">" from links, displaying it as text, rather than hiding it with the rest of the HTML. Whether the </a> or <a href....>'s end tag, I cannot tell. I would like to be able to override somehow the way JTextPane renders links to fix that.

    So far, I have had no success. The closest I have come is that the solution probaly lies with the HTMLEditorKit class, but I don't know for sure, or I wouldn't be asking here.

    So: How can I alter the way JTextPane renders HTML tags, and add tags to its rendering capabilities?

    Thanks in advance.
    Last edited by Gengar003; 05-11-2006 at 12:33 AM.

Similar Threads

  1. Help with HTML to PDF conversion with
    By software_develo in forum .NET
    Replies: 13
    Last Post: 04-18-2013, 10:50 PM
  2. Replies: 0
    Last Post: 07-14-2001, 11:01 AM
  3. changing bgcolor of a row in html table
    By praveen srinivas in forum Web
    Replies: 1
    Last Post: 01-16-2001, 09:52 AM
  4. Changing HTML on the fly
    By John in forum Web
    Replies: 0
    Last Post: 11-17-2000, 09:03 AM
  5. Replies: 0
    Last Post: 09-16-2000, 02:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center