Results 1 to 2 of 2
  1. #1
    sharma_ram is offline Member
    Join Date
    Jan 2010
    Rep Power

    Default Help -- Jeditorpane doesnot support HTML Images for baseline

    Hi All,

    I have an issue with Jeditor pane supporting HTML. It a issue with the baseline where the inline images do not align correctly with the text.
    I have tried different things like..

    - adding align="bottom / middle / absbottom" to the image tag (worked in Firefox but not viewer)
    - adding style="vertical-align:BOTTOM" to the image tag (worked in Firefox but not viewer)
    - adding <sub></sub> around image tag (worked with words in viewer, but image still floating)
    - adding vertical-align: baseline to the span/style attribute (works in Firefox, not in viewer)
    - Switching <span> to <a> in attempt to anchor it to the baseline (works in Firefox, not in viewer)

    Note :viewer is my container for the Jeditor pane.

    Any other ideas?


  2. #2
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Pittsburgh, PA
    Rep Power


    I've never found HTMLDocument and HTMLEditorKit to be very faithful in its rendering of HTML.
    One obvious answer to your problems is to suggest that you rethink your approach:
    Why do you want to display HTML in Java?

    You could try < ... style="vertical-align: +3;" ... >, or whatever displacement works.
    I suspect that HTMLDocument will ignore this style attribute or at least treat it differently from FireFox.

    A less obvious approach is to put blank spacers where you want the images
    and then write code to display the images on top of the HTMLDocument.
    This approach is both difficult and ugly.

Similar Threads

  1. JEditorPane, HTML 4.0, CSS, custom Tags
    By AndreB in forum AWT / Swing
    Replies: 4
    Last Post: 12-22-2009, 10:45 AM
  2. JEditorPane Example
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-27-2008, 07:47 PM
  3. insertHTML in a JEditorPane
    By olbion in forum New To Java
    Replies: 1
    Last Post: 05-05-2008, 12:30 PM
  4. jeditorpane help parsing html
    By asifsolkar in forum Advanced Java
    Replies: 4
    Last Post: 12-14-2007, 05:23 AM
  5. JEditorPane
    By drmmr11 in forum Java Applets
    Replies: 0
    Last Post: 08-02-2007, 06:08 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