Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4796200

HTMLWriter sometimes doesn't output indent

    XMLWordPrintable

Details

    • beta
    • x86
    • windows_nt

    Description

      Name: anR10225 Date: 12/19/2002



      HTMLWriter sometimes doesn't output indent after line break.

      Here's a test case:
      ---------------------------------------------
      import java.io.StringWriter;
      import javax.swing.*;
      import javax.swing.text.html.*;

      public class bug111111 {

          final static String html =
      "<p><i>Para1</i><b>Para1</b><i>Para1</i><b>Para1</b>" +

      "<i>Para1</i><b>Para1</b><i>Para1</i><b>Para1</b><i>Para1</i><b>Para1</b>" +

      "<i>Para1</i><b>Para1</b><i>Para1</i><b>Para1</b><i>Para1</i><b>Para1</b>" +

      "<i>Para1</i><b>Para1</b><i>Para1</i><b>Para1</b><i>Para1</i><b>Para1</b>" +
                  "<i>Para1</i><b>Para1</b>";


          public static void main(String[] args) {
              try {
                  JEditorPane ep = new JEditorPane("text/html", html);
                  HTMLDocument htmldoc = (HTMLDocument) ep.getDocument();

                  StringWriter sw = new StringWriter();
                  HTMLWriter hw = new HTMLWriter(sw, htmldoc);
                  hw.write();
                  sw.close();

                  StringBuffer buf = sw.getBuffer();

                  System.out.println("'" + buf + "'");
              } catch(Exception e) {
                  e.printStackTrace();
              }
          }
      }

      ---------------------------------------------

      ======================================================================
      ###@###.### 10/13/04 17:54 GMT

      Attachments

        Activity

          People

            idk Igor Kushnirskiy (Inactive)
            naasunw Naa Naa (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: