JDK-4419748 : JEditorPane CSS not supporting borders properly
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2001-02-28
  • Updated: 2017-05-16
  • Resolved: 2011-05-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 Other
7 b20Fixed OpenJDK6Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Name: boT120536			Date: 02/27/2001


java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)


The JEditorPane does not properly format borders, as this sample HTML with
inline CSS would demonstrate in a browser window.

<html>
<head>
<style>
body
{
    color: black;
    background: white;
    font-family: Arial, sans-serif;
    font-size: small
}
TH
{
    color: black;
    background: white;
    font-family: Arial, sans-serif;
    font-size: small;
    border-bottom: thin solid black
}    
TR
{
    color: black;
    background: white;
    font-family: Arial, sans-serif;
    font-size: small
}
.summaryCell
{
    color: black;
    background: white;
    font-family: Arial, sans-serif;
    font-size: small;
    border-bottom: thin solid black
}
</style>
</head>
<body bgcolor="white">

<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<tr bgcolor="white">
   <th>&nbsp;</th>
   <th align = "right">Heading 1</th>
   <th align = "right">Heading 2</th>
</tr>
<tr bgcolor="white">
   <td>Set 1-A</td>
   <td align = "right">$65,000</td>
   <td align = "right">$65,000</td>
</tr>
<tr bgcolor="white">
   <td>Set 1-B</td>
   <td align = "right">10,000</td>
   <td align = "right">10,000</td>
</tr>
<tr bgcolor="white">
   <td class="summaryCell">Set 1-C</td>
   <td class="summaryCell" align = "right">5,000</td>
   <td class="summaryCell" align = "right">5,000</td>
</tr>
<tr class="summaryRow" bgcolor="white">
   <td class="summaryCell">Set 2-A</td>
   <td class="summaryCell" align = "right">80,000</td>
   <td class="summaryCell" align = "right">80,000</td>
</tr>

<tr bgcolor="white">
   <td>Set 3-A</td>
   <td align = "right">2,000</td>
   <td align = "right">2,000</td>
</tr>
<tr bgcolor="white">
   <td>Set 3-B</td>
   <td align = "right">78,000</td>
   <td align = "right">78,000</td>
</tr>
<tr bgcolor="white">
   <td>Set 3-C</td>
   <td align = "right">2,000</td>
   <td align = "right">2,000</td>
</tr>
<tr bgcolor="white">
   <td class="summaryCell">Set 3-D</td>
   <td class="summaryCell" align = "right">76,000</td>
   <td class="summaryCell" align = "right">76,000</td>
</tr>

</table>
</body>
</html>
(Review ID: 117797) 
======================================================================

Comments
SUGGESTED FIX Webrev: http://javaweb.sfbay/jcg/7/swing/4419748/
29-06-2007

EVALUATION There are several reasons for the observed behavior. * The Swing CSS parser doesn't understand border shortcuts. * The stock Swing border implementation (which is used for drawing CSS borders) is not suitable for the purpose; for example, it can't draw different borders on different box sides. * The TABLE BORDER attribute value is always propagated down to individual cells as the border-width value; it shouldn't be done if the value is "0". To summarize, the current CSS border support should be re-implemented.
14-06-2007

EVALUATION Since there is a simple workaround I am changing the priority to '4'.
09-09-2005

WORK AROUND One can use <hr> inside <td> to get the underline. for example: --- <html> <head> <style> body { color: black; background: white; font-family: Arial, sans-serif; font-size: small } TH { color: black; background: white; font-family: Arial, sans-serif; font-size: small; border-bottom: thin solid black } TR { color: black; background: white; font-family: Arial, sans-serif; font-size: small } .summaryCell { color: black; background: white; font-family: Arial, sans-serif; font-size: small; border-bottom: thin solid black } </style> </head> <body bgcolor="white"> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <tr bgcolor="white"> <th>&nbsp;<hr></th> <th align = "right">Heading 1<hr></th> <th align = "right">Heading 2<hr></th> </tr> <tr bgcolor="white"> <td>Set 1-A</td> <td align = "right">$65,000</td> <td align = "right">$65,000</td> </tr> <tr bgcolor="white"> <td>Set 1-B</td> <td align = "right">10,000</td> <td align = "right">10,000</td> </tr> <tr bgcolor="white"> <td class="summaryCell">Set 1-C<hr></td> <td class="summaryCell" align = "right">5,000<hr></td> <td class="summaryCell" align = "right">5,000<hr></td> </tr> <tr class="summaryRow" bgcolor="white"> <td class="summaryCell">Set 2-A<hr></td> <td class="summaryCell" align = "right">80,000<hr></td> <td class="summaryCell" align = "right">80,000<hr></td> </tr> <tr bgcolor="white"> <td>Set 3-A</td> <td align = "right">2,000</td> <td align = "right">2,000</td> </tr> <tr bgcolor="white"> <td>Set 3-B</td> <td align = "right">78,000</td> <td align = "right">78,000</td> </tr> <tr bgcolor="white"> <td>Set 3-C</td> <td align = "right">2,000</td> <td align = "right">2,000</td> </tr> <tr bgcolor="white"> <td class="summaryCell">Set 3-D<hr></td> <td class="summaryCell" align = "right">76,000<hr></td> <td class="summaryCell" align = "right">76,000<hr></td> </tr> </table> </body> </html> ---
09-09-2005

WORK AROUND Name: boT120536 Date: 02/27/2001 Instead of adding a border, tried adding <th colspan = "3"><HR noshade></th> to create horizontal lines but this encountered a new problem: a blank line inserted above each HR that could not be removed with any CSS property. ======================================================================
25-09-2004

EVALUATION The javadoc for CSS indicates that this property is currently modeled and not rendered. Moving over to RFE. scott.violet@eng 2001-02-27 ========================= CSS support should be enhanced ###@###.### 2001-11-13 Raising the priority to get it on the JDS P-Team bug list. Needs to stay P2 or above. This is needed for JDS. ###@###.### 2005-1-26 11:25:04 GMT
13-11-2001