Name: jk109818 Date: 02/05/2003
FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
There seems to be five problems related to HTML display:
1. Text in the cells doesn't wrap properly when the available display area is smaller than the table and creates blank lines after the longest lines.
2. The window size is not being calculated correctly when packed, evidenced by the reall tall window that is empty at the bottom.
3. There is a blank line at the bottom of the cells that shouldn't be there.
4. When centered, the last line in the cell doesn't line up with the ones above it.
5. The string of '|' (pipe) characters should not wrap. Only white space should allow strings of characters to wrap.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. compile example below
2. run example
3. resize window smaller than the table
4. observe the strange wrapping behavior
EXPECTED VERSUS ACTUAL BEHAVIOR :
If you save the HTML source below into a file and open it in a modern browser like Internet Explorer 6 and compare the wrapping behavior to my Java example.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
public class TestDialog extends JDialog {
JPanel panel1 = new JPanel();
JScrollPane jScrollPane1 = new JScrollPane();
JTextPane jTextPane1 = new JTextPane();
String content =
"<html><head>" +
"</head><body>" +
"<table border><tr>" +
"<td>X<BR>XXXXX XXXXX<BR>X<BR>X<BR></td>" +
"<td align=center>I<BR>IIIIIIIIIIIIII<BR>I<BR>I</td>" +
"<td align=center>|<BR>||||||||||||||<BR>|<BR>|</td>" +
"</tr></table>" +
"</body></html>";
public TestDialog() {
super((Frame)null, "", true);
jTextPane1.setContentType("text/html");
jTextPane1.setText(content);
jTextPane1.setEditable(false);
this.setModal(true);
this.getContentPane().add(jScrollPane1, BorderLayout.CENTER);
jScrollPane1.getViewport().add(jTextPane1, null);
}
public static void main(String[] args) {
JDialog dlg = new TestDialog();
dlg.pack();
dlg.show();
System.exit(0);
}
}
/* HTML SOURCE FOR COMPARISON IN WEB BROWSERS
<html><head>
</head><body>
<table border><tr>
<td>X<BR>XXXXX XXXXX<BR>X<BR>X<BR></td>
<td align=center>I<BR>IIIIIIIIIIIIII<BR>I<BR>I</td>
<td align=center>|<BR>||||||||||||||<BR>|<BR>|</td>
</tr></table>
</body></html>
*/
---------- END SOURCE ----------
(Review ID: 179306)
======================================================================