Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4419748
Votes 11
Synopsis JEditorPane CSS not supporting borders properly
Category java:classes_swing
Reported Against 1.3
Release Fixed 7(b20), 6-open(b02) (Bug ID:2153782)
State 10-Fix Delivered, request for enhancement
Priority: 4-Low
Related Bugs 6604840 , 6608749 , 6219513
Submit Date 28-FEB-2001
Description


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) 
======================================================================
Posted Date : 2005-09-09 17:32:14.0
Work Around



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.
======================================================================
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>
---
Evaluation
The javadoc for CSS indicates that this property is currently modeled and not rendered. Moving over to RFE.
  xxxxx@xxxxx   2001-02-27
=========================
CSS support should be enhanced
  xxxxx@xxxxx   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.
  xxxxx@xxxxx   2005-1-26 11:25:04 GMT
Since there is a simple workaround I am changing the priority to '4'.
Posted Date : 2005-09-09 17:32:14.0

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.
Posted Date : 2007-06-14 14:16:12.0
Comments
  
  Include a link with my name & email   

Submitted On 07-JUL-2003
asjf
is CSS support due soon?


Submitted On 04-AUG-2006
uvoigt
I wonder that Java is promoted as the language for the WWW and this bug still persists in java 1.6. This has also an effect to the Java Help Viewer where this workaround cannot be done because the HTML files are not only used for Java Help but also for printed documentation.



PLEASE NOTE: JDK6 is formerly known as Project Mustang