United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4866977 : RTL HTML Table fails under JDK1.4.1 and JDK1.4.2, DIR TAG is not supported

Details
Type:
Bug
Submit Date:
2003-05-20
Status:
Closed
Updated Date:
2003-06-17
Project Name:
JDK
Resolved Date:
2003-06-17
Component:
client-libs
OS:
solaris_9
Sub-Component:
javax.swing
CPU:
sparc
Priority:
P3
Resolution:
Duplicate
Affected Versions:
1.4.2
Fixed Versions:

Related Reports
Duplicate:
Relates:

Sub Tasks

Description

Name: rmT116609			Date: 05/20/2003


FULL PRODUCT VERSION :
java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)


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


FULL OS VERSION :
Windows (All platforms), Rdhat Linux 8, Solaris 9 (Sparc & Intel)

A DESCRIPTION OF THE PROBLEM :
The JDK does not support the HTML TAG "dir=rtl". This forbids tables from being rendered and displayed as expected with "dir=RTL" TAG.

Please use netscape 7.x or IE 6 or later view the following HTML code:
 
<html >
<head>
     <title>Test</title>
</head>
<body>
     <div align=right>
          <p><b><font face=Arial color=#5078A8><span lang=he>Hebrew Test</span></font></b>
          </p>
          <p><span lang=he><font face=Arial size=2> HTML Table</font></span></p>
          <table dir =rtl border=1 cellpadding=10 width=62% id=AutoNumber1 bordercolorlight=#FFFFFF bordercolordark=#FFFFFF>
             <tr>
                <td width=28% valign=top bgcolor=#D0E4F8 class=cellclass><font face=Arial size=2 color=#687C98><b>1</b></font>
                </td>
                <td width=72% valign=top bgcolor=#D0E4F8 dir=rtl> <font face=Arial size=2><span lang=he>2</span></font>
                </td>
             </tr>
             <tr>
                <td width=28% valign=top bgcolor=#F8F8FF style=color #687C98><b> <font face=Arial size=2><span lang=he>3</span></font></b>
                 </td> <td width=72% align=right valign=top bgcolor=#F8F8FF> <font face=Arial size=2><span lang=he>4</span></font>
                 </td>
             </tr>
             <tr>
                <td width=28% valign=top bgcolor=#D0E4F8> <font face=Arial size=2 color=#687C98><b>5</b></font></td> <td width=72% align=right valign=top bgcolor=#D0E4F8> <font face=Arial size=2><span lang=he>6 </span></font>
                </td>
             </tr>
             <tr>
                <td width=28%>LEFT&nbsp</td> <td width=72%>RIGHT&nbsp</td>
             </tr>
          </table>
     </div>
</body>
</html>

Please note how the table, cells and data are rendered correctly

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Open the following file fields.html in IE5 or above or NN7 and note that the table is rendered correctly with dir =rtl.

Compile and execute the following test.java example.
Note that the table, cells and data are rendered LTR and not RTL.

import java.awt.*;
import java.awt.font.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.text.*;

public class test extends JApplet
{
  public void init()
  {
    jHTMLTest jEditorPane2 = new jHTMLTest();
    getContentPane().add(jEditorPane2);
  }

  public static void main(String[] args)
  {
    JFrame frame = new JFrame("\u0645\u062b\u0627\u0644");
    frame.setContentPane(new jHTMLTest());
    frame.setSize(600,500);
    frame.setVisible(true);
        frame.addWindowListener( new WindowAdapter()
        {
             public void windowClosing( WindowEvent e)
             {
                 System.exit(0);
             }
        });

  }
}
class jHTMLTest extends JPanel
{
  public jHTMLTest()
  {
    JPanel panel = new JPanel();
    JEditorPane pane;
    pane = new JEditorPane();
    pane.setContentType("text/html");
    pane.setPreferredSize(new Dimension(400, 400));
    pane.setSize(pane.getPreferredSize());
    String hebrew = " <html > <head>  <title>Test</title> <style> </style> </head> <body> <div align
=right> <p><b><font face=Arial color=#5078A8><span lang=he>Hebrew Test</span></font></b></p> <p><spa
n lang=he><font face=Arial size=2> HTML Table</font></span></p> <table dir =rtl border=1 cellpadding
=10 width=62% id=AutoNumber1 bordercolorlight=#FFFFFF bordercolordark=#FFFFFF> <tr> <td width=28% va
lign=top bgcolor=#D0E4F8 class=cellclass><font face=Arial size=2 color=#687C98><b>1</b></font></td>
<td width=72% valign=top bgcolor=#D0E4F8 dir=rtl> <font face=Arial size=2><span lang=he>2</span></fo
nt></td> </tr> <tr> <td width=28% valign=top bgcolor=#F8F8FF style=color #687C98><b> <font face=Aria
l size=2><span lang=he>3</span></font></b></td> <td width=72% align=right valign=top bgcolor=#F8F8FF
> <font face=Arial size=2><span lang=he>4</span></font></td> </tr> <tr> <td width=28% valign=top bgc
olor=#D0E4F8> <font face=Arial size=2 color=#687C98><b>5</b></font></td> <td width=72% align=right v
align=top bgcolor=#D0E4F8> <font face=Arial size=2><span lang=he>6 </span></font></td> </tr> <tr> <t
d width=28%>LEFT&nbsp</td> <td width=72%>RIGHT&nbsp</td> </tr> </table> </div> </body> </html> ";
    panel.setPreferredSize(new Dimension(400, 400));
    panel.setSize(panel.getPreferredSize());
    pane.setText(hebrew);
    panel.add(pane);
   add(panel);
  }
}




EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Table and contents are rendered RTL
ACTUAL -
Table and contents are rendered LTR

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.font.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.text.*;

public class test extends JApplet
{
  public void init()
  {
    jHTMLTest jEditorPane2 = new jHTMLTest();
    getContentPane().add(jEditorPane2);
  }

  public static void main(String[] args)
  {
    JFrame frame = new JFrame("\u0645\u062b\u0627\u0644");
    frame.setContentPane(new jHTMLTest());
    frame.setSize(600,500);
    frame.setVisible(true);
        frame.addWindowListener( new WindowAdapter()
        {
             public void windowClosing( WindowEvent e)
             {
                 System.exit(0);
             }
        });

  }
}
class jHTMLTest extends JPanel
{
  public jHTMLTest()
  {
    JPanel panel = new JPanel();
    JEditorPane pane;
    pane = new JEditorPane();
    pane.setContentType("text/html");
    pane.setPreferredSize(new Dimension(400, 400));
    pane.setSize(pane.getPreferredSize());
    String hebrew = " <html > <head>  <title>Test</title> <style> </style> </head> <body> <div align
=right> <p><b><font face=Arial color=#5078A8><span lang=he>Hebrew Test</span></font></b></p> <p><spa
n lang=he><font face=Arial size=2> HTML Table</font></span></p> <table dir =rtl border=1 cellpadding
=10 width=62% id=AutoNumber1 bordercolorlight=#FFFFFF bordercolordark=#FFFFFF> <tr> <td width=28% va
lign=top bgcolor=#D0E4F8 class=cellclass><font face=Arial size=2 color=#687C98><b>1</b></font></td>
<td width=72% valign=top bgcolor=#D0E4F8 dir=rtl> <font face=Arial size=2><span lang=he>2</span></fo
nt></td> </tr> <tr> <td width=28% valign=top bgcolor=#F8F8FF style=color #687C98><b> <font face=Aria
l size=2><span lang=he>3</span></font></b></td> <td width=72% align=right valign=top bgcolor=#F8F8FF
> <font face=Arial size=2><span lang=he>4</span></font></td> </tr> <tr> <td width=28% valign=top bgc
olor=#D0E4F8> <font face=Arial size=2 color=#687C98><b>5</b></font></td> <td width=72% align=right v
align=top bgcolor=#D0E4F8> <font face=Arial size=2><span lang=he>6 </span></font></td> </tr> <tr> <t
d width=28%>LEFT&nbsp</td> <td width=72%>RIGHT&nbsp</td> </tr> </table> </div> </body> </html> ";
    panel.setPreferredSize(new Dimension(400, 400));
    panel.setSize(panel.getPreferredSize());
    pane.setText(hebrew);
    panel.add(pane);
   add(panel);
  }
}

---------- END SOURCE ----------
(Review ID: 185939) 
======================================================================

                                    

Comments
EVALUATION

DIR is part of html4.x specs. We currently do not suport this spec.
Closing this bug as dup of 4296022
                                     
2004-06-11



Hardware and Software, Engineered to Work Together