-
Bug
-
Resolution: Fixed
-
P5
-
5.0
-
beta
-
x86
-
windows_nt
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
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